Forum Search:
Forum.Brain-Cluster.com: Brain Cluster Technical Forum
Ultimate forum for Technical Discussions

Home » Microsoft » Windows Server » Active Directory » dsquery
dsquery [message #316835] Fri, 13 November 2009 11:56 Go to next message
Matt  is currently offline Matt  United States
Messages: 70
Registered: August 2009
Member
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
Re: dsquery [message #316923 is a reply to message #316835] Fri, 13 November 2009 13:35 Go to previous messageGo to next message
aceman  is currently offline aceman  United States
Messages: 5816
Registered: July 2009
Senior Member
"Matt" <mm@bb.com> wrote in message
news:OV9BGMJZKHA.5544@TK2MSFTNGP02.phx.gbl...
> 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/archive/index.php/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.
Re: dsquery [message #317303 is a reply to message #316835] Sat, 14 November 2009 01:32 Go to previous messageGo to next message
florian  is currently offline florian  Germany
Messages: 484
Registered: July 2009
Senior Member
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=*)(groupType<=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.
Re: dsquery [message #317610 is a reply to message #317303] Sat, 14 November 2009 13:39 Go to previous messageGo to next message
Matt  is currently offline Matt  United States
Messages: 70
Registered: August 2009
Member
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]" <florian@frickelsoft.DELETETHIS.net> wrote in
message news:%23a8glVQZKHA.1640@TK2MSFTNGP06.phx.gbl...
> 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=*)(groupType<=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.
Re: dsquery [message #317638 is a reply to message #317610] Sat, 14 November 2009 14:14 Go to previous messageGo to next message
rlmueller-nospam  is currently offline rlmueller-nospam  United States
Messages: 292
Registered: July 2009
Senior Member
You can add the member attribute to the list. For example (one line):

adfind -default -f
"(&(objectCategory=group)(legacyExchangeDN=*)(groupType<=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" <mm@bb.com> wrote in message
news:euOhGqWZKHA.5108@TK2MSFTNGP06.phx.gbl...
> 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]" <florian@frickelsoft.DELETETHIS.net> wrote in
> message news:%23a8glVQZKHA.1640@TK2MSFTNGP06.phx.gbl...
>> 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=*)(groupType<=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.
>
>
Re: dsquery [message #317654 is a reply to message #317638] Sat, 14 November 2009 14:29 Go to previous messageGo to next message
Matt  is currently offline Matt  United States
Messages: 70
Registered: August 2009
Member
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-nospam@ameritech.nospam.net> wrote in
message news:ODw5E%23WZKHA.616@TK2MSFTNGP04.phx.gbl...
> You can add the member attribute to the list. For example (one line):
>
> adfind -default -f
> "(&(objectCategory=group)(legacyExchangeDN=*)(groupType<=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" <mm@bb.com> wrote in message
> news:euOhGqWZKHA.5108@TK2MSFTNGP06.phx.gbl...
>> 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]" <florian@frickelsoft.DELETETHIS.net> wrote in
>> message news:%23a8glVQZKHA.1640@TK2MSFTNGP06.phx.gbl...
>>> 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=*)(groupType<=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.
>>
>>
>
>
Re: dsquery [message #317688 is a reply to message #317654] Sat, 14 November 2009 15:36 Go to previous messageGo to next message
rlmueller-nospam  is currently offline rlmueller-nospam  United States
Messages: 292
Registered: July 2009
Senior Member
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" <mm@bb.com> wrote in message
news:uv7mTGXZKHA.1640@TK2MSFTNGP06.phx.gbl...
> 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-nospam@ameritech.nospam.net> wrote in
> message news:ODw5E%23WZKHA.616@TK2MSFTNGP04.phx.gbl...
>> You can add the member attribute to the list. For example (one line):
>>
>> adfind -default -f
>> "(&(objectCategory=group)(legacyExchangeDN=*)(groupType<=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" <mm@bb.com> wrote in message
>> news:euOhGqWZKHA.5108@TK2MSFTNGP06.phx.gbl...
>>> 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]" <florian@frickelsoft.DELETETHIS.net> wrote in
>>> message news:%23a8glVQZKHA.1640@TK2MSFTNGP06.phx.gbl...
>>>> 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=*)(groupType<=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.
>>>
>>>
>>
>>
>
>
Re: dsquery [message #320311 is a reply to message #317688] Tue, 17 November 2009 13:51 Go to previous message
Matt  is currently offline Matt  United States
Messages: 70
Registered: August 2009
Member
Richard,

Thanks for the input! Works great..

Matt


"Richard Mueller [MVP]" <rlmueller-nospam@ameritech.nospam.net> wrote in
message news:euzhYrXZKHA.5608@TK2MSFTNGP05.phx.gbl...
> 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" <mm@bb.com> wrote in message
> news:uv7mTGXZKHA.1640@TK2MSFTNGP06.phx.gbl...
>> 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-nospam@ameritech.nospam.net> wrote in
>> message news:ODw5E%23WZKHA.616@TK2MSFTNGP04.phx.gbl...
>>> You can add the member attribute to the list. For example (one line):
>>>
>>> adfind -default -f
>>> "(&(objectCategory=group)(legacyExchangeDN=*)(groupType<=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" <mm@bb.com> wrote in message
>>> news:euOhGqWZKHA.5108@TK2MSFTNGP06.phx.gbl...
>>>> 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]" <florian@frickelsoft.DELETETHIS.net> wrote in
>>>> message news:%23a8glVQZKHA.1640@TK2MSFTNGP06.phx.gbl...
>>>>> 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=*)(groupType<=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.
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Previous Topic:Managing Service Principle Names
Next Topic:Group Object missing in ADUC properties of "managed by"
Goto Forum:
  


Current Time: Wed Jan 17 04:14:33 MST 2018

Total time taken to generate the page: 0.01906 seconds
.:: Contact :: Home ::Sitemap::.

Powered by: FUDforum 3.0.0RC2.
Copyright ©2001-2009 FUDforum Bulletin Board Software