WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADSI
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

List Computer Objects

 Keywords: List Enumerate Itemize Computer Objects objectCategory dsFindPath

;***************************************************************************
;**
;**    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 )

Article ID:   W17530
Filename:   List Computer Objects.txt
File Created: 2012:11:15:14:07:00
Last Updated: 2012:11:15:14:07:00