Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Enumerating computers Win2k AD domain
I'll appreciate if someone can post a sample script please. Many thanks in advance.
;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))") AskItemlist('Compiter list', ComputerPaths, @TAB, @UNSORTED, @SINGLE )
Older example:
AddExtender("wwads34I.dll") ; Set credentials dsSetCredent("Buda", "********") sAdsiPath = "LDAP://MyDomain" ; Get all computers sSearch = "objectCategory=computer" lPaths= dsFindPath(sAdsiPath, sSearch) lCompNames = "" ; Need to initialize. nCount = ItemCount(lPaths, @Tab) for i=1 to nCount ; Get the common name. sPath = ItemExtract(i, lPaths, @Tab) sCompName = dsGetProperty(sPath, "cn") lCompNames = ItemInsert(sCompName,-1, lCompNames, @Tab) next ; Display the results. lCompNames = strreplace(lCompNames,@TAB, @CRLF) Message("Computers", lCompNames)
Article ID: W14510
Filename: Enumerating computers in a Win2k AD domain.txt
File Created: 2012:11:15:09:20:16
Last Updated: 2012:11:15:09:20:16