Previously we've learned how to Abdou develop of description use and power show.
Now let's take a look at updating telephone numbers of multiple users.
This operation is a little different from updating the description of operation here.
They have two complexities which are as follows.
The first one we don't know which attribute will get updated when a number is added to the telephone
number field and the graphical user interface.
And the second complexity is performing a telephone number obtained from multiple users by reading from
a text file or CSP file.
First we need to identify attributes that need to be updated.
So when we want to update that office telephone number home number and my Bible number of the users
if this users already have this number set then we can use the attribute editor to identify the attribute
names that need to be updated.
If not then we need to say that these telephone numbers for one user account and land use attribute
editor to identify the attribute names.
Alternatively you can use that get a user come and lead to retrieve all attributes the Power Shell is
preferred here as we want to learn more and more about it.
Let's examine the output of the following command carefully and identify the attribute names that have
their telephone numbers you see in the graphical user interface.
So first let's run this command get a user identity Tom call Carl so mandrill be looking for all the
properties of this object.
You'll notice that the following command have the telephone number you see in the graphical user interface
and it outputs too much information which you don't need right now.
So we could select some properties we need right now.
So let's run this command again as pipe and select home phone office phone and my bile form the description
of the Presidium command is shown in the foreign office phone this attribute contains the phone number
that you see on there under the main field and telephone numbers in Active Directory administrative
center an Active Directory Users some computers.
You'll see this number in the telephone number field in the general term home phone.
This is the phone number you will see in the home phone field and more biol.
This attribute contains the phone number you see in the mobile field.
First let's update the telephone details so while you are there then we can extend the logic.
Did other users in Baalke.
Let's talk the numbers in variables.
First let's grade three variables for office number home number and mobile number.
The first variable will contain.
Sorry will be named Dolor character office number and will be equal to the number we need.
Then we will have home number and my Bible number wearables.
The next step is to update the Presidium values for a user account as shown in this command set.
Daresay the user has the following properties identity office phone which will get the wearable of office
number home phone mobile phone.
This is a straight forward because the set does say the user command Let has parameters that can set
these phone numbers in the attribute that you are trying to set is not available as a parameter to the
command left.
Then you can use the dash add parameter to directly specify the attribute name and the value.
Similarly you can use the parameter such as Desch replace and dash clear parameter to the Chris attributes
directly.
The Bruce that an example can be rewritten using their deaths add parameter.
So let's review this command cert.
There's a user again with identity parameter and clear parameter.
So real quickly are telephone number home phone and mobile.
And again we'll run the full and that a user's identity and at the following parameters.
So telephone number will be equal to office number Meribel home phone number and my bile to my biol
number variable.
Now we can extend this logic to multiple users use an hour for looping power shell before doing this.
Store the user names and numbers of want to set in a specific file and imported into power shell.
So I have the for unsisterly file.
Let me open it and show you the values of this file and the code to set the telephone numbers will look
like that Rillette variable and other variable users which will be equal equal to the full and command
imperf. says the command left and the file in which you have all the telephone numbers which you want
to add to your users.
Then for each user in this file which is equal to users wearable fill out the form in code below your
set there's a D command left with identity property which will be equal to user with username property
office phone will be equal to office number variable which we've said before and the same goes for home
phone and mobile phone.
Now check one of these users let's say Jondo in a Users and Computers console and see if his phone number
is the one we need.
That's open Users and Computers console right click on the domain and search for the name John Allen
and his properties in general.
We can find the phone number it can do the same years in Active Directory administrative center.
Again we click right click on the demand and search for the name John.
And here we have all three numbers which we've modified before.
Also if you scroll down to the bottom you'll you could find this attributes all the attributes which
could be used to modify this object this user object.