Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: dsMoveObj Move Computer Object Between Containers Different OU
;*************************************************************************** ;** ;** List Computer Objects ;** ;*************************************************************************** ;Load Appropriate Extender If WinMetrics(-2) == 3 Then AddExtender("WWADS64I.DLL") ; 64-bit Else AddExtender("WWADS44I.DLL") ; 32-bit ; Construct the full domain ADSI path. ServerDn = dsGetProperty("LDAP://rootDSE", "serverName") ServerName = ItemExtract(1, ServerDn, ",") ServerName = ItemExtract(2, ServerName, "=") ServerDn = dsGetProperty("LDAP://rootDSE", "defaultNamingContext") ServerPath = "LDAP://%ServerName%/%ServerDN%" ; Find the computers path ComputerPaths = dsFindPath(ServerPath, "(&(objectCategory=computer))") objComputerPath = AskItemlist('Computer Objects', ComputerPaths, @TAB, @UNSORTED, @SINGLE ) ;*************************************************************************** ;** ;** List OU Objects ;** ;*************************************************************************** ;Load Appropriate Extender If WinMetrics(-2) == 3 Then AddExtender("WWADS64I.DLL") ; 64-bit Else AddExtender("WWADS44I.DLL") ; 32-bit ; Construct the full domain ADSI path. ServerDn = dsGetProperty("LDAP://rootDSE", "serverName") ServerName = ItemExtract(1, ServerDn, ",") ServerName = ItemExtract(2, ServerName, "=") ServerDn = dsGetProperty("LDAP://rootDSE", "defaultNamingContext") ServerPath = "LDAP://%ServerName%/%ServerDN%" ; Find the OU paths OUPaths = dsFindPath(ServerPath, "(&(objectCategory=organizationalunit)(ou=*))") targetOUpath = AskItemlist('OU Objects', OUPaths, @TAB, @UNSORTED, @SINGLE ) ;*************************************************************************** ;** ;** dsMoveObj ;** This function moves an ADSI object from one container to another. ;** The object can optionally be renamed by providing a new name in the third parameter ;** ;*************************************************************************** dsMoveObj(objComputerPath, targetOUpath , "")
Article ID: W15389
File Created: 2012:11:16:11:00:38
Last Updated: 2012:11:16:11:00:38