Friday, July 6, 2012

PS Script to move users to an OU

AD Functional Account cleanup , i created this script to move a list of users from multiple OUs to an OU
where they will be mass disabled.

import-CSV c:\testdisableduseraccounts.csv -Header @("Name") | foreach-object { Get-ADUser $_.Name | Move-ADObject -Targetpath "ou=temp disabled,ou=disabled user accounts,dc=DC,dc=DC,dc=domain,dc=com" }

No comments:

Post a Comment