Solved

Bulk change to Active Directory Telephone Number Field

Posted on 2010-09-16
7
2,644 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:
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 70

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
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 transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

770 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