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, ou=IT Computers, OU=MainSite, OU=Sites, dc=domain, dc=com“
strUser = „domein\ beheerder“
strPassword = InputBox („ga wachtwoord in: “)
Reeks objDSO = GetObject („LDAP: “)
Reeks objNewOU = objDSO.OpenDSObject (strNewOUPath, strUser, strPassword, ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)
Op Fout hervat daarna
objNewOU.MoveHere strComputerPath, het vbNullString
Als Err.Number = 0 toen
MsgBox „met succes bewogen Computer.“
Anders
De „fout“ van MsgBox & Err.Number & „: “ & Err.Description
Eind als
|