[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

AD "Saved Query" help

Posted on 2011-05-02
6
Medium Priority
?
369 Views
Last Modified: 2012-05-11
I need to make a query in AD (Saved Query) to search an attribute (ipPhone) and find anyone who doesn't have this value set. I tried this but it doesn't work.
(&ipPhone=<NULL>)
(&ipPhone=<>)

However this one does work
(&ipPhone=STAFF)

I know the basic syntax is right but what do I put in if the expected value is blank?
0
Comment
Question by:ubsoc
  • 4
  • 2
6 Comments
 
LVL 57

Expert Comment

by:Mike Kline
ID: 35505960
Try

!ipphone=*

! = not

I'll test in a bit

Thanks

Mike
0
 
LVL 57

Accepted Solution

by:
Mike Kline earned 2000 total points
ID: 35505998
ok just tested (used adfind for my test)

I set ipphone for one test user and you can see it only returned the one and when I added not/! I got back my others users.

See screenshot

Thanks

Mike
ipphone.png
0
 
LVL 5

Author Comment

by:ubsoc
ID: 35506000
ipPhone=* works as it reports back a huge list
However !ipPhone=* does not report anything

I know there are a couple users with that value empty.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
LVL 5

Author Comment

by:ubsoc
ID: 35506022
OK, so I used your complete verbage of (objectcategory=person)(objectclass=user)(!ipPhone=*) and that works!
just using (!ipPhone=*) does not work and that is what I was trying.

Thanks for the help
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 35506032
If you did it like this (in ADUC) it would work

(!(ipphone=*))

...that would give you everything though

(&(objectcategory=person)(objectclass=user)(!(ipphone=*)))

for just users (see screenshot)

Thanks

Mike
ipphone2.png
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 35506041
glad to help out
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
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 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…
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 …
Suggested Courses

864 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