登录$ComputerName为本地管理员Windows Server 2008 R2 SP1
这个脚本:
$admin=[adsi]("WinNT://" + $ComputerName + "/administrator, user")
$admin.psbase.invoke("SetPassword", $Password)
$admin.psbase.CommitChanges()
Run Code Online (Sandbox Code Playgroud)
本地运行抛出异常: Exception calling "Invoke" with "2" argument(s):"The network path was not found"
小智 1
还没有测试过这个,但我发现
\n\n([adsi]\xe2\x80\x9cWinNT://<Local or Remote Computer Name>/<Username>\xe2\x80\x9d).SetPassword(\xe2\x80\x9c<Password>\xe2\x80\x9d)\nRun Code Online (Sandbox Code Playgroud)\n\nhttp://www.petri.co.il/how-to-change-user-password-with-powershell.htm
\n| 归档时间: |
|
| 查看次数: |
34934 次 |
| 最近记录: |