AD: find disabled accounts and Move them to specific OU

 

dsquery user -limit 0 -disabled "ou=usuarios,dc=deltalab,dc=com" >disabled.txt

for /f "delims=" %a in (disabled.txt) do dsmove %a -newparent "OU=ZZZ,DC=deltalab,DC=com"

Comments

Post a Comment

Popular posts from this blog

[Batch file] - Output of a command to variable

HP NC375i adapter in Proliant DL580 G7 stops responding