Solved

Bulk change to Active Directory Telephone Number Field

Posted on 2010-09-16
7
2,670 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

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.

Question has a verified solution.

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

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

820 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