Previously we have learned how to update the value of description used in power show.
Now let's take a look at update and telephone numbers of multiple users.
This operation is a little different from updating the description 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 failed in the graphical user interface.
And the second complexity is performing a telephone number update for 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 the office telephone number home number and mobile number of the users if
this user is already have this number set then we can use that attribute editor to identify the attribute
names that need to be updated.
If not then we need to set these telephone numbers for one user account and then use attribute editor
to identify the attribute names.
Alternatively you can use they get this 80 user command led to retrieve all attributes the power shall
we say 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
the telephone numbers you see in the graphical user interface.
So first let's run this command get there say the user identity.
TOM call.
CARL So my aunt will be looking for all the properties of this object.
You'll notice that the following command has a telephone number as 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 with pipe and select home phone office phone and mobile phone.
The description of the precedent command is shown in the forward an office phone.
This attribute contains the phone number that you see on the under the main field and telephone numbers
in Active Directory administrative center an Active Directory user some computer you'll see this number
in the telephone number field in the general term home phone.
This is a phone number you will see in the home phone field and mobile.
This attribute contains the phone number you will see in the mobile field.
First let's update the telephone details so one year.
Then we can extend the logic to did other users in bulk let's store the numbers in variables first let's
create three variables for office number home number and mobile number.
The first variable will contain sorry will be named dollar character office number and will be equal
to the number we need.
Then we'll have home number and mobile number wearables.
The next step is to update the preceding values for a user account as shown in this command set.
There say the user is the following properties identity office phone which will get the variable of
office number home form mobile form.
This is a straight forward because the set the shady user command led has parameters that can set these
phone numbers.
If the attribute that you are trying to set is not available as a parameter to the command led then
you can use the dash add parameter to directly specify the attribute name and the value.
Similarly you can use as a parameter such as this replace and dash clear parameter to your Chris attributes
directly the precedent example can be rewritten using the dash add parameter.
So let's review this command set.
There's a user again with identity parameter and clear parameter.
So we'll be clear telephone number home phone and mobile and again will run the following command said
a user identity and at the following parameters so telephone number will be equal to offers no variable
home phone to home number and mobile to mobile number variable.
Now we can extend this logic to multiple users using a for loop in power shell.
Before doing this store the user names and numbers of want to set in a ceasefire file and imported into
power shall so I have the following ancestry 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 will add a variable and other variable
users which will be equal equal to the following command import CEV command led 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 will add the following code will you set this a d command led with
identity property which will be equal to user with user name property office phone will be equal to
office number variable which we have said before and the same goes for home phone and mobile phone.
Now let's check one of those users let's say John Doe in 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 and in
his properties in general.
We can find the phone number we can do the same year in active directory administrative center again
we click right click on the domain 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 could find this attribute all the attributes which could be
used to modify this object.
This user object.