Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Searching for a space in AD fields

Posted on 2009-04-07
1
Medium Priority
?
266 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
[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
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

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

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
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 …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

610 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