to run an LDAP query to pull out all of the users. You can then step through the collection and list them out with whatever info you want.
Here's a user-extraction query that gets user name, Distinguished name and login script path
Set objRootDSE = GetObject("LDAP://RootDSE")
strConfig = objRootDSE.Get("configurationNamingContext")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
' Initiate ADO
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
' Assemble query string
strBase = ""
strFilter = "(&(objectCategory=person)(objectClass=user))"
strAttributes = "distinguishedName,Name,ScriptPath"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
' set parameters
objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 60
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
wscript.echo objRecordSet.Fields("Name") & vbtab & objRecordSet.Fields("scriptPath")
objRecordSet.MoveNext
Loop
Have fun...
Neil :D
p.s. No, I won't debug it and I may well have made a slepling mistake! although if I spot any myself, I'll fix 'em.