?
Solved

Bulk change to Active Directory Telephone Number Field

Posted on 2010-09-16
7
Medium Priority
?
2,797 Views
Last Modified: 2012-06-21
Hello,

I need to update our Active Directory email field to remove the first digit which is a zero.  This change needs to occur on every user object\account that has a telephone number field.  I imagine this would be some sort of powershell or ldap script?  I guess I would need error checking to ignore empty fields such as service accounts that would not contain telephone number entries.  

Can anyone provide me with a sample script or point me in the right direction.

Many thanks,
0
Comment
Question by:theslaw2326
[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
7 Comments
 
LVL 24

Accepted Solution

by:
Mike Thomas earned 1000 total points
ID: 33689614
0
 
LVL 1

Author Comment

by:theslaw2326
ID: 33690164
Hi,

Thanks that looks good.  It is flexable enough to remove the first number in the field as if I use a find and replace for a zero '0' it will replace all if any exisit in the field not just the first digit?
0
 
LVL 24

Expert Comment

by:Mike Thomas
ID: 33690187
Yeah it would do that, btw if you want to change the telephone number to be the same for all users you can select all users (CTRL+A) in an OU, do a right click properties and change them en mass by ticking the appropriate box without the need for this tool.


0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 5

Assisted Solution

by:chqshaitan
chqshaitan earned 1000 total points
ID: 33690243
admodify is another program that should do what you want or you could do a ldife export to a spreadsheet, then manipulate the data and re-import.

I have done this in the past.

admodify link - http://www.computerperformance.co.uk/w2k3/utilities/admodify.htm

csvde/ldife examples - http://www.computerperformance.co.uk/Logon/CSVDE_LDIFDE.htm
0
 
LVL 27

Expert Comment

by:KenMcF
ID: 33804587
You could use powershell and the quest ad cmdlests. I am not sure what your emails look like but if there is only the one 0 in them you could do a replace.

$users = get-qaduser -ldapfilter "(&(objectcategory=person)(objectclass=user)(PhoneNumber=*))"
foreach($User in $Users){
If (($user.Mail).startswith("0") -eq $True){
$newmail = $user.mail -replace "0", ""
set-qaduser $user -mail $newmail
}}
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 34182401
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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
Course of the Month15 days, 17 hours left to enroll

741 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