2008-09-16 27 views

Respuesta

6

Su secuencia de comandos estaba realmente cerca de correcto (y realmente aprecio su respuesta).

el siguiente script es lo que solía resolver mi problema .:

$from = [ADSI]"LDAP://CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca" 
$to = [ADSI]"LDAP://OU=Temporarily Moved Groups, DC=Company,DC=ca" 
$from.PSBase.MoveTo($to,"cn="+$from.name) 
+0

Gran !! ¡Gracias por publicar la actualizacion! –

3

No he probado esto todavía, pero esto debería hacerlo ..

$objectlocation= 'CN=IT Department, OU=Technology Department, OU=Departments,DC=Company,DC=ca' 
$newlocation = 'OU=Temporarily Moved Groups, DC=Company,DC=ca' 

$from = new-object System.DirectoryServices.DirectoryEntry("LDAP://$objectLocation") 
$to = new-object System.DirectoryServices.DirectoryEntry("LDAP://$newlocation") 
$from.MoveTo($newlocation,$from.name) 
Cuestiones relacionadas