Re: Query users from specific groups
- From: "Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 07:53:09 -0500
Mihai Serban wrote:
I want to extract from Active Directory all users who are membes of
specific groups, starting with "ras". Can help me to resolv that problem?
Thanks
Hi,
You can use ADO in a script. Info on ADO linked here:
http://www.rlmueller.net/ADOSearchTips.htm
In you case (based on the first example in the above link), use:
strFilter = "(&(objectCategory=group)(sAMAccountName=ras*))"
strAttributes = "sAMAccountName,member"
This will return one row for each group whose NetBIOS name starts with
"ras". It will return the NetBIOS name of the group and the member
multi-valued attribute. For each group (row in the recordset) you will have
to enumerate the member collection. There is an example in the link to
enumerate the memberOf attribute, which is similar to the member attribute.
The same method can be used.
You also might be able to use ADFind for this, Joe Richard's utility.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
.
- References:
- Query users from specific groups
- From: Mihai Serban
- Query users from specific groups
- Prev by Date: RE: move-mailbox cmdlet problem when invoked in c# code.
- Next by Date: Re: Newbie to scripting. Printer Management Question.
- Previous by thread: Query users from specific groups
- Next by thread: Re: Newbie to scripting. Printer Management Question.
- Index(es):
Relevant Pages
|