enumerate Domain Users



Hi,

I need a VBS script that can enumerate all Users of a win2000 and win2003
domain.
I would need the following 3 attributes from the ADS for each Domainuser :

sAMAccountname,Description,Department


I have tried some LDAP queries... but I dont get these 3 attributes....

the code I use enumerates all Users for a group, but I dont get the 3
attributes that I need.
Also I need all users of the domain - not of a group (though I think each
Domain user is by default in the Domain Users group...?)

Currenty I use something like this:

strContainer = (points to Domain Users Group)
Set objRootDSE = GetObject("LDAP://RootDSE";)
Set objGroup = GetObject ("LDAP://"&; strContainer)

objGroup.getInfo

arrMemberOf = objGroup.GetEx("member")

wscript.echo strContainer & ":"
For Each strGroupMember in arrMemberOf
wscript.echo strGroupMember
Next


How should I modify this code - or write some new code, that enumerats all
Domain users with the attributes that I need?
(Would be perfect if I dont have to hardcode the domain name..but use
DefaultDomain....)

thank you


.



Relevant Pages

  • enumerate all Domainusers
    ... I need a VBS script that can enumerate all Users of a win2000 and win2003 ... but I dont get these 3 attributes.... ... For Each strGroupMember in arrMemberOf ...
    (microsoft.public.scripting.vbscript)
  • FindWindow...next?
    ... How can I enumerate through the calculator forms? ... I dont want to use EnumWindows and check for the handles (bit overdone I ...
    (microsoft.public.dotnet.languages.csharp)
  • Driver Tree enumeration!!
    ... enumerate the drivers installed on a system and the hierarchy ... What I need is exactly what OSR's device tree provides but i dont have ... the source code for that. ...
    (microsoft.public.development.device.drivers)
  • Re: enumerate Domain Users
    ... I need a VBS script that can enumerate all Users of a win2000 and win2003 ... but I dont get these 3 attributes.... ... Domain user is by default in the Domain Users group...?) ... For Each strGroupMember in arrMemberOf ...
    (microsoft.public.scripting.wsh)

Loading