Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Active Directory > dsquery

Reply
 
 
Matt
Guest
Posts: n/a

 
      11-13-2009
Hi All,

My client is looking for a list of all mail enabled groups and each groups
members. (Don't need any security groups that have e-mail addresses
enabled). Is this possible with dsquery and if so what would be the correct
command? If not is there something else I could use?

Thanks Much!

Matt


 
Reply With Quote
 
 
 
 
Ace Fekay [MCT]
Guest
Posts: n/a

 
      11-13-2009
"Matt" <> wrote in message
news:...
> Hi All,
>
> My client is looking for a list of all mail enabled groups and each groups
> members. (Don't need any security groups that have e-mail addresses
> enabled). Is this possible with dsquery and if so what would be the
> correct command? If not is there something else I could use?
>
> Thanks Much!
>
> Matt
>



You are better off using a script to pull this info. Take a look at the
following link.

"This script exports all smtp address, I only want the primary..."
http://www.petri.co.il/forums/archiv...p/t-19411.html


--
Ace

This posting is provided "AS-IS" with no warranties or guarantees and
confers no rights.

Please reply back to the newsgroup or forum for collaboration benefit among
responding engineers, and to help others benefit from your resolution.

Ace Fekay, MCT, MCITP EA, MCTS Windows 2008 & Exchange 2007, MCSE & MCSA
2003/2000, MCSA Messaging 2003
Microsoft Certified Trainer

For urgent issues, please contact Microsoft PSS directly. Please check
http://support.microsoft.com for regional support phone numbers.


 
Reply With Quote
 
Florian Frommherz [MVP]
Guest
Posts: n/a

 
      11-14-2009

Howdie!

Matt schrieb:
> My client is looking for a list of all mail enabled groups and each groups
> members. (Don't need any security groups that have e-mail addresses
> enabled). Is this possible with dsquery and if so what would be the correct
> command? If not is there something else I could use?


Using ADFind from joeware.net, you could go with a query like this:

adfind -default -f
"&(objectClass=group)(legacyexchangedn=*)(groupTyp e<=8)" samaccountname

That should print out all sAMAccountNames of all distribution groups.

Cheers,
Florian
--
Microsoft MVP - Group Policy
eMail: prename [at] frickelsoft [dot] net.
blog: http://www.frickelsoft.net/blog.
ANY advice you get on the Newsgroups should be tested thoroughly in your
lab.
 
Reply With Quote
 
Matt
Guest
Posts: n/a

 
      11-14-2009
Florian,

Thanks for the input. The command gave me all the mail enabled groups but I
also need a list of the members of each group. What can I change in the
command to supply the group and the members?

Thanks!

Matt


"Florian Frommherz [MVP]" <> wrote in
message news:%...
> Howdie!
>
> Matt schrieb:
>> My client is looking for a list of all mail enabled groups and each
>> groups members. (Don't need any security groups that have e-mail
>> addresses enabled). Is this possible with dsquery and if so what would be
>> the correct command? If not is there something else I could use?

>
> Using ADFind from joeware.net, you could go with a query like this:
>
> adfind -default -f
> "&(objectClass=group)(legacyexchangedn=*)(groupTyp e<=8)" samaccountname
>
> That should print out all sAMAccountNames of all distribution groups.
>
> Cheers,
> Florian
> --
> Microsoft MVP - Group Policy
> eMail: prename [at] frickelsoft [dot] net.
> blog: http://www.frickelsoft.net/blog.
> ANY advice you get on the Newsgroups should be tested thoroughly in your
> lab.



 
Reply With Quote
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      11-14-2009
You can add the member attribute to the list. For example (one line):

adfind -default -f
"(&(objectCategory=group)(legacyExchangeDN=*)(grou pType<=8))"
sAMAccountName, member

The member attribute is a collection of group DN's.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Matt" <> wrote in message
news:...
> Florian,
>
> Thanks for the input. The command gave me all the mail enabled groups but
> I also need a list of the members of each group. What can I change in the
> command to supply the group and the members?
>
> Thanks!
>
> Matt
>
>
> "Florian Frommherz [MVP]" <> wrote in
> message news:%...
>> Howdie!
>>
>> Matt schrieb:
>>> My client is looking for a list of all mail enabled groups and each
>>> groups members. (Don't need any security groups that have e-mail
>>> addresses enabled). Is this possible with dsquery and if so what would
>>> be the correct command? If not is there something else I could use?

>>
>> Using ADFind from joeware.net, you could go with a query like this:
>>
>> adfind -default -f
>> "&(objectClass=group)(legacyexchangedn=*)(groupTyp e<=8)" samaccountname
>>
>> That should print out all sAMAccountNames of all distribution groups.
>>
>> Cheers,
>> Florian
>> --
>> Microsoft MVP - Group Policy
>> eMail: prename [at] frickelsoft [dot] net.
>> blog: http://www.frickelsoft.net/blog.
>> ANY advice you get on the Newsgroups should be tested thoroughly in your
>> lab.

>
>



 
Reply With Quote
 
Matt
Guest
Posts: n/a

 
      11-14-2009
Richard,

Thanks that worked great! One last question. I didn't see in the options how
to output the results to a txt file. Is that possible?

Thanks,

Matt

"Richard Mueller [MVP]" <rlmueller-> wrote in
message news:ODw5E%...
> You can add the member attribute to the list. For example (one line):
>
> adfind -default -f
> "(&(objectCategory=group)(legacyExchangeDN=*)(grou pType<=8))"
> sAMAccountName, member
>
> The member attribute is a collection of group DN's.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
> "Matt" <> wrote in message
> news:...
>> Florian,
>>
>> Thanks for the input. The command gave me all the mail enabled groups but
>> I also need a list of the members of each group. What can I change in the
>> command to supply the group and the members?
>>
>> Thanks!
>>
>> Matt
>>
>>
>> "Florian Frommherz [MVP]" <> wrote in
>> message news:%...
>>> Howdie!
>>>
>>> Matt schrieb:
>>>> My client is looking for a list of all mail enabled groups and each
>>>> groups members. (Don't need any security groups that have e-mail
>>>> addresses enabled). Is this possible with dsquery and if so what would
>>>> be the correct command? If not is there something else I could use?
>>>
>>> Using ADFind from joeware.net, you could go with a query like this:
>>>
>>> adfind -default -f
>>> "&(objectClass=group)(legacyexchangedn=*)(groupTyp e<=8)" samaccountname
>>>
>>> That should print out all sAMAccountNames of all distribution groups.
>>>
>>> Cheers,
>>> Florian
>>> --
>>> Microsoft MVP - Group Policy
>>> eMail: prename [at] frickelsoft [dot] net.
>>> blog: http://www.frickelsoft.net/blog.
>>> ANY advice you get on the Newsgroups should be tested thoroughly in your
>>> lab.

>>
>>

>
>



 
Reply With Quote
 
Richard Mueller [MVP]
Guest
Posts: n/a

 
      11-14-2009
There is a -csv option for adfind. Check the syntax help at a command line
with adfind /?, or at this link:

http://www.joeware.net/freetools/tools/adfind/usage.htm

Also, you can always redirect the output of any command line utility to a
text file. For example:

adfind -default -f "(objectCategory=group)" sAMAccountName, member >
report.txt

However, the -csv option creates a comma delimited file, which may be
better. You can specify the delimiter.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--

"Matt" <> wrote in message
news:...
> Richard,
>
> Thanks that worked great! One last question. I didn't see in the options
> how to output the results to a txt file. Is that possible?
>
> Thanks,
>
> Matt
>
> "Richard Mueller [MVP]" <rlmueller-> wrote in
> message news:ODw5E%...
>> You can add the member attribute to the list. For example (one line):
>>
>> adfind -default -f
>> "(&(objectCategory=group)(legacyExchangeDN=*)(grou pType<=8))"
>> sAMAccountName, member
>>
>> The member attribute is a collection of group DN's.
>>
>> --
>> Richard Mueller
>> MVP Directory Services
>> Hilltop Lab - http://www.rlmueller.net
>> --
>>
>> "Matt" <> wrote in message
>> news:...
>>> Florian,
>>>
>>> Thanks for the input. The command gave me all the mail enabled groups
>>> but I also need a list of the members of each group. What can I change
>>> in the command to supply the group and the members?
>>>
>>> Thanks!
>>>
>>> Matt
>>>
>>>
>>> "Florian Frommherz [MVP]" <> wrote in
>>> message news:%...
>>>> Howdie!
>>>>
>>>> Matt schrieb:
>>>>> My client is looking for a list of all mail enabled groups and each
>>>>> groups members. (Don't need any security groups that have e-mail
>>>>> addresses enabled). Is this possible with dsquery and if so what would
>>>>> be the correct command? If not is there something else I could use?
>>>>
>>>> Using ADFind from joeware.net, you could go with a query like this:
>>>>
>>>> adfind -default -f
>>>> "&(objectClass=group)(legacyexchangedn=*)(groupTyp e<=8)" samaccountname
>>>>
>>>> That should print out all sAMAccountNames of all distribution groups.
>>>>
>>>> Cheers,
>>>> Florian
>>>> --
>>>> Microsoft MVP - Group Policy
>>>> eMail: prename [at] frickelsoft [dot] net.
>>>> blog: http://www.frickelsoft.net/blog.
>>>> ANY advice you get on the Newsgroups should be tested thoroughly in
>>>> your lab.
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Matt
Guest
Posts: n/a

 
      11-17-2009
Richard,

Thanks for the input! Works great..

Matt


"Richard Mueller [MVP]" <rlmueller-> wrote in
message news:...
> There is a -csv option for adfind. Check the syntax help at a command line
> with adfind /?, or at this link:
>
> http://www.joeware.net/freetools/tools/adfind/usage.htm
>
> Also, you can always redirect the output of any command line utility to a
> text file. For example:
>
> adfind -default -f "(objectCategory=group)" sAMAccountName, member >
> report.txt
>
> However, the -csv option creates a comma delimited file, which may be
> better. You can specify the delimiter.
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
> "Matt" <> wrote in message
> news:...
>> Richard,
>>
>> Thanks that worked great! One last question. I didn't see in the options
>> how to output the results to a txt file. Is that possible?
>>
>> Thanks,
>>
>> Matt
>>
>> "Richard Mueller [MVP]" <rlmueller-> wrote in
>> message news:ODw5E%...
>>> You can add the member attribute to the list. For example (one line):
>>>
>>> adfind -default -f
>>> "(&(objectCategory=group)(legacyExchangeDN=*)(grou pType<=8))"
>>> sAMAccountName, member
>>>
>>> The member attribute is a collection of group DN's.
>>>
>>> --
>>> Richard Mueller
>>> MVP Directory Services
>>> Hilltop Lab - http://www.rlmueller.net
>>> --
>>>
>>> "Matt" <> wrote in message
>>> news:...
>>>> Florian,
>>>>
>>>> Thanks for the input. The command gave me all the mail enabled groups
>>>> but I also need a list of the members of each group. What can I change
>>>> in the command to supply the group and the members?
>>>>
>>>> Thanks!
>>>>
>>>> Matt
>>>>
>>>>
>>>> "Florian Frommherz [MVP]" <> wrote in
>>>> message news:%...
>>>>> Howdie!
>>>>>
>>>>> Matt schrieb:
>>>>>> My client is looking for a list of all mail enabled groups and each
>>>>>> groups members. (Don't need any security groups that have e-mail
>>>>>> addresses enabled). Is this possible with dsquery and if so what
>>>>>> would be the correct command? If not is there something else I could
>>>>>> use?
>>>>>
>>>>> Using ADFind from joeware.net, you could go with a query like this:
>>>>>
>>>>> adfind -default -f
>>>>> "&(objectClass=group)(legacyexchangedn=*)(groupTyp e<=8)"
>>>>> samaccountname
>>>>>
>>>>> That should print out all sAMAccountNames of all distribution groups.
>>>>>
>>>>> Cheers,
>>>>> Florian
>>>>> --
>>>>> Microsoft MVP - Group Policy
>>>>> eMail: prename [at] frickelsoft [dot] net.
>>>>> blog: http://www.frickelsoft.net/blog.
>>>>> ANY advice you get on the Newsgroups should be tested thoroughly in
>>>>> your lab.
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DSQUERY to get the members of a Group in AD Bob Randall Active Directory 10 11-11-2009 04:09 PM
Re: dsquery and dsget Meinolf Weber [MVP-DS] Active Directory 0 11-01-2009 09:39 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59