使用AzureRM Rest API在VM上重置本地管理员用户 [英] Reset Local Admin User on VM using AzureRM Rest api

查看:54
本文介绍了使用AzureRM Rest API在VM上重置本地管理员用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AzureRM rest api与管理程序进行通信.我需要做的一件事是在VM上重置本地管理员密码,但是我不知道如何重置它.

解决方案

我们可以使用

4.使用重置密码成功远程迁移虚拟机.

我们还可以在Azure门户中重置我们的本地管理员密码.

I'm using the AzureRM rest api to communicate to the hypervisor. One of the things I need to do is to reset the local admin password on a VM, however I can't figure out how to reset it.

解决方案

We could use the Virtual Machine Extensions REST API to do that. It works correctly for me. Following is my detail test info.

1.We need to get the authorization in the request header

Authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUz.......
Content-Type:application/json

2.Add the following info in the request body

{
  "properties": {
    "publisher": "Microsoft.Compute",
    "type": "VMAccessAgent",
    "typeHandlerVersion": "2.0",
    "autoUpgradeMinorVersion": true,
    "settings": {
      "UserName": "local admin"  //your local admin
    },
    "protectedSettings": {
      "Password": "your reset passord" //match the password policy
    }
  },
  "location": "East Asia"
}

  1. Send the http request with Fiddler.

4 . Successfully remote the VM with reset password.

We also can reset our local admin password in the Azure portal.

这篇关于使用AzureRM Rest API在VM上重置本地管理员用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆