regw333 发表于 2014-12-29 09:09:41

如何筛选AD中已禁用的计算机账号并移动到指定的OU

备注:下面的第一条和第二条的命令已经结合实际生产环境修改过并验证过。


(一)筛选AD中被停用的计算机账号,然后统一移动到discomputer组织单位中

Search-ADAccount -AccountDisabled -ComputersOnly | Move-ADObject -TargetPath "OU=discomputer,OU=IT
,DC=contoso,DC=Com"


(二)使用下面命令可以查询某个OU下面已经禁用的计算机账号

Search-ADAccount -AccountDisabled -Searchbase "OU=IT,DC=Contoso,DC=Com"
-ComputersOnly


(三)其他AD Powershell计算机、账户、组管理常用命令参考

http://social.technet.microsoft.com/wiki/contents/articles/5819.ad-powershell-for-active-directory-administrators.aspx

页: [1]
查看完整版本: 如何筛选AD中已禁用的计算机账号并移动到指定的OU