我正在尝试使用Powershell脚本向域添加主机.当通过CloudFormation或Ansible调用脚本时,脚本失败并显示以下错误.当我在主机上手动运行它时,它会成功.
我怀疑我做错了用户(我手动运行管理员)所以我试图强迫它一直以管理员身份运行.不幸的是,这也没有用.
有没有人见过这个问题?
错误:
> [DEBUG] Command 4-add-to-domain output: Add-Computer : Computer
> 'WIN-xxxxx' failed to join domain
>
> 'aws.cloud.bp.com' from its current workgroup 'WORKGROUP' with
> following error
>
> message: Unable to update the password. The value provided as the
> current
>
> password is incorrect.
>
> At line:1 char:1
>
> + Add-Computer -DomainName $domain -Credential $credential -OUPath $ouPath
>
> -Restar ...
>
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ~~~
>
> + CategoryInfo …Run Code Online (Sandbox Code Playgroud)