使用场景
通过Powershell命令,快速查询AD中被锁定的域账号。
操作步骤
-
查询所有被锁定的用户:
get-aduser -filter -properties | where {$.lockedout} | ft name,lockedout -
查询指定OU被锁定的用户:
get-aduser -searchbase ' OU=IT,DC=Pushits,DC=COM ' -filter -properties | where {$.lockedout} | ft name,lockedout - 解锁锁定账号:
Unlock-ADAccount -Identity zhangla1