Solved

Bulk change to Active Directory Telephone Number Field

Posted on 2010-09-16
7
2,580 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
7 Comments
 
LVL 24

Accepted Solution

by:
MojoTech earned 250 total points
Comment Utility
0
 
LVL 1

Author Comment

by:theslaw2326
Comment Utility
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:MojoTech
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 5

Assisted Solution

by:chqshaitan
chqshaitan earned 250 total points
Comment Utility
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
Comment Utility
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 70

Expert Comment

by:Chris Dent
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

This article will help you understand what HashTables are and how to use them in PowerShell.
A procedure for exporting installed hotfix details of remote computers using powershell
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 …

728 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

10 Experts available now in Live!

Get 1:1 Help Now