At work we just got a whole new range of phone numbers. This means that every phonenumber is changed. This needs to be reflected in our Active Directory for easy access and other dependancies. There is a simple excel file which includes the following attributes (phonenumber) (extension) (first lastname). The extension can be deleted since it is included in the main number, so that is not important. Unfortunately the source file does not include an UPN.
I have looked at options to do this, a whole bunch of them were suggested here. However, all those that could possible do what we need are based on installed software. This is however not an option on our server.
Therefore my question is, is there a way to mass edit everything in a command promt or powershell? I would like to do something like this, but then something for unique attributes for specified users;
get-aduser -filter { city -like 'Glitter*' } | set-aduser -city 'Las Vegas' -PostalCode 89123 –PassThru
Assuming your source file is set up like it is in your question this should be a good start for what you need. Convert your source file to a csv to save you some headache. This assumes that the first line is
first lastname,phonenumber,extension
. Order does not matter.We use
Get-ADUser
to find the "one" user and make changes based the record in your source file. You can leave-Whatif
in there for testing. PowerShell will tell you it is editing so you can get a feel for what is happening. We are assuming-OfficePhone
is the attribute you are updating.