首页 > 解决方案 > 在 Azure 中重置域控制器的密码

问题描述

我正在尝试使用自定义脚本扩展来重置我的域控制器的密码。

net user 'username@domain.com' 'xX@123456'

脚本部署成功,但我无法使用新密码登录。 在此处输入图像描述

在详细信息状态中,我看到以下内容 -

[
    {
        "code": "ComponentStatus/StdOut/succeeded",
        "level": "Info",
        "displayStatus": "Provisioning succeeded",
        "message": ""
    },
    {
        "code": "ComponentStatus/StdErr/succeeded",
        "level": "Info",
        "displayStatus": "Provisioning succeeded",
        "message": "The syntax of this command is:\\n\\nNET USER\\n[username [password | *] [options]] [/DOMAIN]\\n         username {password | *} /ADD [options] [/DOMAIN]\\n         username [/DELETE] [/DOMAIN]\\n         username [/TIMES:{times | ALL}]\\n         username [/ACTIVE: {YES | NO}]\\n\\nThere is no such global user or group: username@domain.com.\\n\\nMore help is available by typing NET HELPMSG 3783.\\n\\nThere is no such global user or group: username@domain.com.\\n\\nMore help is available by typing NET HELPMSG 3783.\\n"
    }
]

我不确定以下消息的含义 -

该命令的语法是:\n\nNET USER\n[用户名 [密码 | *] [options]] [/DOMAIN]\n 用户名 {密码 | *} /ADD [options] [/DOMAIN]\n 用户名 [/DELETE] [/DOMAIN]\n
用户名 [/TIMES:{times | ALL}]\n 用户名 [/ACTIVE: {YES | NO}]\n\n没有这样的全局用户或组:username@domain.com。\n\n通过键入 NET HELPMSG 3783 可以获得更多帮助。\n\n没有这样的全局用户或组:username@domain。 com。\n\n可通过键入 NET HELPMSG 3783 获得更多帮助。\n

标签: azuredomaincontroller

解决方案


不是确切的解决方案,但是您可以在删除用户并再次将其添加到管理员组后使用以下解决方案。

首先,使用以下命令查看当前的 Local Admin 用户(属于 Local Administrators 组的用户):

=> 网络本地组管理员

检查要添加到本地管理员组的用户或组是否不存在,如果不是,请使用以下命令将域管理员添加到本地管理员组:

网络本地组管理员/添加“域\域管理员”| ei : net localgoup 管理员 /add "Microsoft\Domain Admins"

在域和管理员之间有一个空格,因此您必须添加符号“”(引用)

此外,您必须在 /add 之后而不是之前指定组或用户:)。

资料来源:技术网


推荐阅读