DSQuery command with a not equal to syntax??

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
ejmeadoAsked:
Who is Participating?
 
Mike KlineCommented:
Put a not character (!) in front of the primarygroupid in your query

example  !primarygroupid=512

Thanks

Mike
0
 
ejmeadoAuthor Commented:
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
 
Mike KlineCommented:
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
 
ejmeadoAuthor Commented:
Thank you, that worked a treat.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.