Solved

DSQuery command with a not equal to syntax??

Posted on 2010-11-17
4
1,551 Views
Last Modified: 2012-05-10
I have successfully run a dsquery to find accounts  with a primary group of domain users.  
 Is it possible to run a dsquery to users whos primary group is not equal to a group ID. Thank you
0
Comment
Question by:ejmeado
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 57

Accepted Solution

by:
Mike Kline earned 500 total points
ID: 34159774
Put a not character (!) in front of the primarygroupid in your query

example  !primarygroupid=512

Thanks

Mike
0
 

Author Comment

by:ejmeado
ID: 34160069
Thank you Mike,  I tried the ! it in front of the =, the query ran without an output.  I will test it in the morining.
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 34160582
Do it in front of the primary;  see my screenshot using adfind by Joe Richards  http://www.joeware.net/freetools/tools/adfind/index.htm

I first looked for all accounts who had a primarygroupid of 513   then added the not! and it only returned the account that didn't have 513 as its primary group

513 is Domain Users

Thanks

Mike
primarygroupid.png
0
 

Author Comment

by:ejmeado
ID: 34167941
Thank you, that worked a treat.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question