Const ADS_SECURE_AUTHENTICATION = &H1
Const ADS_USE_ENCRYPTION = &H2
Const ADS_SERVER_BIND = &H200
strNewOUPath = “LDAP: /dcserver.domain.com/OU=Computers,OU=MainSite,OU=Sites,dc=domain,dc=com”
strComputerPath = “LDAP: //CN=ComputerNameToMove, computadoras del ou=IT, OU=MainSite, OU=Sites, dc=domain, dc=com”
strUser = “dominio \ administrador”
strPassword = InputBox (“incorporar la contraseña: ")
Fijar el objDSO = GetObject (“LDAP: ")
Fijar el objNewOU = objDSO.OpenDSObject (strNewOUPath, strUser, strPassword, ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
En error reasumir después
strComputerPath de objNewOU.MoveHere, vbNullString
Si Err.Number = 0 entonces
MsgBox “computadora movida con éxito.”
“Error” de MsgBox y Err.Number y “: ” Y Err.Description
Terminar si
|