How do I output an LDAP query based distribution group to file?

I need to output members of a query based LDAP distribution group to a text file. I have seen numerous solutions which are fine if I wanted to achieve the same thing with an ordinary static or distribution group, but none of them help me to output from a query based. I am using Exchange 2003, and I note that this feature appears to be built into 2007.

Anyone got any utilities to achieve this or a simple script I can run? Thanks in advance.
partnershipdevAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Can you once share the query with me ?
0
shadowlesssCommented:
Is this what you are looking for?

http://support.microsoft.com/kb/555937
0
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Try this
dsget group "cn=GROUPNAME,OU=OUNAME,DC=DOMAIN,DC=Local" -members > c:\members.txt
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
DSQuery * "CN=Former,OU=Former Colleagues,OU=User Accounts,OU=IND,OU=Countries,DC=Development" -Attr Member -L -Limit 0
0
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Hello partnershipdev were we able to get the data with the command that i provided as i have used it and got so was curious to know ......
0
partnershipdevAuthor Commented:
Okay, the group I need to interrogate is called Chester and is under DOMAIN | Groups | Dynamic Distribution Groups in AD, so would the command line be as follows:

dsget group "cn=Chester,OU=Dynamic Distribution Groups,OU=Groups,DC=domain,DC=com" -members > c:\members.txt

I'm sure I'm getting the syntax wrong somewhere!
0
partnershipdevAuthor Commented:
I would imagine the command works fine, but I got one of our developers to create an LDAP query VB script that outputs to .TXT which has solved my problem.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.