天天看点

查询所有被禁用的域账号并批量转移至某个OU

1

<code>get-aduser</code> <code>-Filter</code> <code>*</code> <code>-SearchBase</code> <code>"DC=contoso,DC=com"</code> <code>| </code><code>foreach</code> <code>{</code><code>if</code> <code>(</code><code>$_</code><code>.enabled </code><code>-eq</code> <code>$false</code><code>){</code><code>$_</code><code>.ObjectGUID} } | </code><code>Move-ADObject</code> <code>-TargetPath</code>  <code>"OU=deluser,OU=delusers,DC=Contoso,DC=com"</code>

本文转自handsome7038 51CTO博客,原文链接:http://blog.51cto.com/lixiaosong/1338719

继续阅读