温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Win2008/2012r2下批量更改域用户密码

发布时间:2020-07-26 22:59:20 来源:网络 阅读:3698 作者:kangl 栏目:系统运维

使用Windows PowerShell批量更改AD用户的密码,使用以下命令,修改对应字段,执行即可。

1、打开Windows PowerShell加载AD模块:

Import-Module ActiveDirectory
2、更改所有域用户的密码:
Get-ADUser -filter * -SearchBase 'DC=xxx,DC=com' | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "abc123AA" -Force)

3、更改指定“test”OU中所有域用户的密码:
Get-ADUser -filter * -SearchBase 'OU=test,DC=xxx,DC=com' | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "123!@#" -Force)
4、设置域用户下次登陆时不需要更改密码:
Get-ADUser -filter * -SearchBase 'DC=xxx,DC=com' | Set-ADUser -ChangePasswordAtLogon $false

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI