"Jason" <Jason@newsgroup> wrote in message
news:uR9kTBflKHA.2188@newsgroup
> Hello All
>
> I'm trying to List out about 75 users from a windows server security group
> 2003. I have one security with about 75 users i need to check that all the
> users are acount for
>
> Cheers If the group is a local group, a VBScript program can use the WinNT provider
to bind to the group object, then use the Members collection to enumerate
the members. For example:
=========
' Specify NetBIOS name of computer.
strComputer = "MyServer"
' Specify name of local group.
strGroup = "MyGroup"
' Bind to the local group object.
Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup &
",group")
' Enumerate direct members of the group.
For Each objMember In objGroup.Members
' Display the name of the member.
Wscript.Echo objMember.Name
Next
========
You could run this script at a command prompt with the cscript host and
redirect the output to a text file. For example, if the VBScript program is
saved in the file Group.vbs, the command could be:
cscript //nologo Group.vbs > report.txt
This assumes you are in the folder where the file Group.vbs is saved.
Otherwise, you must specify the full path. If the group is a domain group
(in Active Directory), you should use the LDAP provider. The VBScript
program would be similar, but you would bind with the full Distinguished
Name of the group. For example:
============
' Specify the full Distinguished Name of the group.
strGroup = "cn=Test Group,ou=Sales,ou=West,dc=MyDomain,dc=com"
' Bind to the the group object.
Set objGroup = GetObject("LDAP://" & strGroup)
' Enumerate direct members of the group.
For Each objMember In objGroup.Members
' Display Distinguished Name and "pre-Windows 2000 logon" name of
member.
Wscript.Echo objMember.distinguishedName & " (" &
objMember.sAMAccountName & ")"
Next
============
You would run this the same way at a command prompt with cscript so you can
redirect the output to a text file. I hope this helps.
--
Richard Mueller
MVP Directory Services
Hilltop Lab -
http://www.rlmueller.net
--