Active Directory LDAP query to find users NOT in specific groups

15 pts.
Tags:
Active Directory
Exchange 2007 databases
LDAP
Microsoft Exchange 2007
Hi. I am using Exchange 2007. I am trying to do a specific search for users in active directory WITH email addresses that are NOT present in 14 specific groups. I want the results to show these users who are NOT in the 14 specified groups. I haven't used LDAP in a while so I'm a bit rusty but I'm open to anything that will get these users NOT in those groups and exported to a spreadsheet. THANKS!

Answer Wiki

Thanks. We'll let you know when a new response is added.

I would suggest you try the PowerGUI utility. It does a great job of querying AD for groups and users.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Yankz23
    i downloaded it and gave it a quick try. im not sure its going to give me what i need but its a nice utility. i see theres other things i could use. i hope hope to learn more when i get some real time to play with it. thanks
    15 pointsBadges:
    report
  • maonayze
     
    30 pointsBadges:
    report
  • maonayze
    Opps Sorry for previous blank post. Has anyone answered this yet because it was bugging me something rotten...until I cracked it.In the saved queries, Click Define Query and go into the advanced tab of Users,Contacts and GroupsClick Field buttonUse the User>MemberofCondition = IsnotValue must be Distinguished Name of Group....not the group nameQuickest way to get Distinguished Name of group is through ADSIEdit, unless you want to work it through and type it in of course.Repeat for each group you want to check against. Hope this helps as it worked for me. I only had to do two groups but it should be okay.
    30 pointsBadges:
    report
  • maonayze
    Sorry about the blank post above. Not sure if this has been solved yet, but it has been bugging me for a few days. I needed to find out which users were not members of any internet access group, so I could put them in one to gain internet access when they get back from holiday. I dont want over 8000 users ringing me on Monday saying they got no internet.When setting the check for each group do the followingUser>Memberofset the condition to IsnotValue = Distinguished Name of Group, not GroupNameIt doesnt work using GroupName but when I entered the Distinguished Name of a group I wanted to check, it worked. All you need to do is put in a condition for each of the groups you need to check the user is a member of.Hope this helps, it worked for me.
    30 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following