Solved

Bulk change to Active Directory Telephone Number Field

Posted on 2010-09-16
7
2,754 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 250 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
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 
LVL 5

Assisted Solution

by:chqshaitan
chqshaitan earned 250 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

687 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