'one way of doing it
'this will work with Active Dir and NT domains
Set Container = GetObject("WinNT://DomainNameHere")
Container.Filter = Array("user")
For Each User In Container
For Each aGroup In User.Groups
Wscript.Echo User.Name & "=" & aGroup.Name
Next
Next
'if you want other user properties then
Set Container = GetObject("WinNT://DOMFSC01")
Container.Filter = Array("user")
For Each User In Container
Wscript.Echo User.Name & "=" & User.LastLogin
Next
'the WinNT provider does not expose all of the AD properties,only the ones which were available in NT domains, if you want to do that then use ADSI and an LDAP query to return more fields/properties
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.