Solved

Searching for a space in AD fields

Posted on 2009-04-07
1
249 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Introduction You may have a need to setup a group of users to allow local administrative access on workstations.  In a domain environment this can easily be achieved with Restricted Groups and Group Policies. This article will demonstrate how to…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
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 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 …

914 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now