微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

使用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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐