Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DSQuery command with a not equal to syntax??

Posted on 2010-11-17
4
Medium Priority
?
1,579 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 2000 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

721 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