Solved

Searching for a space in AD fields

Posted on 2009-04-07
1
253 Views
Last Modified: 2012-05-06
Due to a mistake made by one of our programmers we are in a situation where there are several users who have a space " " in some of their AD fields. Most notably their cell phone field. What the programmer did was inadvertently pass a space " " character rather than a null value. What I would like to do is find a way to clean this up.

I have tried doing a query in ADUC to find users where the mobile number starts with a space " " but it returns all users in AD.

Is there a way to search for a space " " character in a query.

0
Comment
Question by:Joseph Daly
1 Comment
 
LVL 35

Accepted Solution

by:
Joseph Daly earned 0 total points
ID: 24088604
Ok so did a little digging on google and came up with a webpage that was able to help me. For those wh may need this solution in the future. The command I used was.

dsquery * -filter "(&((&objectCategory=user)(mobile=\20)))" | dsmod user -mobile ""

You have to escape the space character and then I guess 20 is the hex code for a space.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Mapping Drives using Group policy preferences Are you still using old scripts to map your network drives if so this article will show you how to get away for old scripts and move toward Group Policy Preference for mapping them. First things f…
Last week, our Skyport webinar on “How to secure your Active Directory” (https://www.experts-exchange.com/videos/5810/Webinar-Is-Your-Active-Directory-as-Secure-as-You-Think.html) provided 218 attendees with a step-by-step guide for identifying Acti…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 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