Move users in AD


hi,

i using dsquery  & dsmove move users in root of users ou alphbetical users ou's ie z within users ou. see following example c:\windows\system32\cmd.exe /c /f "delims=" %a in ('dsquery user -limit 0 "ou=users,dc=myserver,dc=co,dc=uk" -name "s*"') @dsmove %a -newparent "ou=s,ou=users,dc=myserver,dc=co,dc=uk"
run scheduled task have run 26 of these tasks i.e. z. there way can move users in 1 script, in powershell, jave or batchfile? 

you can in powershell.  it's easier code if have w7 ad module rsat tools (and requried gateway service running on @ least 1 of dcs), or quest ad cmdlets.


[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

some help on Event 540

WMI Repository 4GB limit - Win 2003 Ent Question

Event ID 1302 (error 1307) DFS replication service encountered an error while writing to the debug log file