1 00:00:06,410 --> 00:00:12,600 Previously we have learned how to update the value of description used in power show. 2 00:00:12,620 --> 00:00:18,040 Now let's take a look at update and telephone numbers of multiple users. 3 00:00:18,050 --> 00:00:24,040 This operation is a little different from updating the description operation here. 4 00:00:24,150 --> 00:00:27,790 They have two complexities which are as follows. 5 00:00:27,890 --> 00:00:35,420 The first one we don't know which attribute will get updated when a number is added to the telephone 6 00:00:35,420 --> 00:00:39,420 number failed in the graphical user interface. 7 00:00:39,500 --> 00:00:48,260 And the second complexity is performing a telephone number update for multiple users by reading from 8 00:00:48,260 --> 00:00:51,540 a text file or CSP file. 9 00:00:51,560 --> 00:00:56,210 First we need to identify attributes that need to be updated. 10 00:00:56,210 --> 00:01:04,640 So when we want to update the office telephone number home number and mobile number of the users if 11 00:01:04,640 --> 00:01:14,510 this user is already have this number set then we can use that attribute editor to identify the attribute 12 00:01:14,510 --> 00:01:17,090 names that need to be updated. 13 00:01:17,090 --> 00:01:26,450 If not then we need to set these telephone numbers for one user account and then use attribute editor 14 00:01:26,720 --> 00:01:29,360 to identify the attribute names. 15 00:01:29,540 --> 00:01:38,570 Alternatively you can use they get this 80 user command led to retrieve all attributes the power shall 16 00:01:38,570 --> 00:01:43,640 we say is preferred here as we want to learn more and more about it. 17 00:01:43,730 --> 00:01:51,110 Let's examine the output of the following command carefully and identify the attribute names that have 18 00:01:51,110 --> 00:01:55,670 the telephone numbers you see in the graphical user interface. 19 00:01:55,790 --> 00:02:02,450 So first let's run this command get there say the user identity. 20 00:02:02,510 --> 00:02:03,240 TOM call. 21 00:02:03,260 --> 00:02:09,110 CARL So my aunt will be looking for all the properties of this object. 22 00:02:09,110 --> 00:02:16,160 You'll notice that the following command has a telephone number as you see in the graphical user interface 23 00:02:16,370 --> 00:02:21,830 and it outputs too much information which you don't need right now. 24 00:02:21,830 --> 00:02:26,240 So we could select some properties we need right now. 25 00:02:26,480 --> 00:02:34,750 So let's run this command again with pipe and select home phone office phone and mobile phone. 26 00:02:34,760 --> 00:02:40,250 The description of the precedent command is shown in the forward an office phone. 27 00:02:40,250 --> 00:02:48,140 This attribute contains the phone number that you see on the under the main field and telephone numbers 28 00:02:48,230 --> 00:02:56,350 in Active Directory administrative center an Active Directory user some computer you'll see this number 29 00:02:56,370 --> 00:03:01,190 in the telephone number field in the general term home phone. 30 00:03:01,190 --> 00:03:06,650 This is a phone number you will see in the home phone field and mobile. 31 00:03:06,680 --> 00:03:11,440 This attribute contains the phone number you will see in the mobile field. 32 00:03:11,540 --> 00:03:15,370 First let's update the telephone details so one year. 33 00:03:15,680 --> 00:03:26,000 Then we can extend the logic to did other users in bulk let's store the numbers in variables first let's 34 00:03:26,000 --> 00:03:31,730 create three variables for office number home number and mobile number. 35 00:03:31,730 --> 00:03:39,350 The first variable will contain sorry will be named dollar character office number and will be equal 36 00:03:39,350 --> 00:03:41,180 to the number we need. 37 00:03:41,270 --> 00:03:44,890 Then we'll have home number and mobile number wearables. 38 00:03:44,900 --> 00:03:51,800 The next step is to update the preceding values for a user account as shown in this command set. 39 00:03:51,830 --> 00:04:00,290 There say the user is the following properties identity office phone which will get the variable of 40 00:04:00,410 --> 00:04:04,250 office number home form mobile form. 41 00:04:04,250 --> 00:04:11,870 This is a straight forward because the set the shady user command led has parameters that can set these 42 00:04:11,870 --> 00:04:13,100 phone numbers. 43 00:04:13,100 --> 00:04:20,690 If the attribute that you are trying to set is not available as a parameter to the command led then 44 00:04:20,690 --> 00:04:29,420 you can use the dash add parameter to directly specify the attribute name and the value. 45 00:04:29,690 --> 00:04:40,040 Similarly you can use as a parameter such as this replace and dash clear parameter to your Chris attributes 46 00:04:40,040 --> 00:04:46,490 directly the precedent example can be rewritten using the dash add parameter. 47 00:04:46,490 --> 00:04:49,710 So let's review this command set. 48 00:04:49,720 --> 00:04:57,050 There's a user again with identity parameter and clear parameter. 49 00:04:57,140 --> 00:05:06,270 So we'll be clear telephone number home phone and mobile and again will run the following command said 50 00:05:06,360 --> 00:05:16,110 a user identity and at the following parameters so telephone number will be equal to offers no variable 51 00:05:16,320 --> 00:05:22,070 home phone to home number and mobile to mobile number variable. 52 00:05:22,080 --> 00:05:29,600 Now we can extend this logic to multiple users using a for loop in power shell. 53 00:05:29,700 --> 00:05:38,790 Before doing this store the user names and numbers of want to set in a ceasefire file and imported into 54 00:05:38,790 --> 00:05:48,120 power shall so I have the following ancestry file let me open it and show you the values of this file 55 00:05:48,450 --> 00:05:56,880 and the code to set the telephone numbers will look like that will add a variable and other variable 56 00:05:57,180 --> 00:06:06,000 users which will be equal equal to the following command import CEV command led and the file in which 57 00:06:06,000 --> 00:06:15,060 you have all the telephone numbers which you want to add to your users then for each user in this file 58 00:06:15,360 --> 00:06:24,660 which is equal to users wearable will add the following code will you set this a d command led with 59 00:06:24,810 --> 00:06:33,780 identity property which will be equal to user with user name property office phone will be equal to 60 00:06:34,080 --> 00:06:42,810 office number variable which we have said before and the same goes for home phone and mobile phone. 61 00:06:42,810 --> 00:06:53,310 Now let's check one of those users let's say John Doe in users and computers console and see if his 62 00:06:53,310 --> 00:06:56,370 phone number is the one we need. 63 00:06:56,430 --> 00:07:05,130 That's open users and computers console right click on the domain and search for the name John and in 64 00:07:05,130 --> 00:07:07,690 his properties in general. 65 00:07:07,980 --> 00:07:16,290 We can find the phone number we can do the same year in active directory administrative center again 66 00:07:16,320 --> 00:07:25,290 we click right click on the domain and search for the name John and here we have all three numbers which 67 00:07:25,290 --> 00:07:27,330 we've modified before. 68 00:07:27,360 --> 00:07:36,270 Also if you scroll down to the bottom you could find this attribute all the attributes which could be 69 00:07:36,270 --> 00:07:39,990 used to modify this object. 70 00:07:40,110 --> 00:07:41,420 This user object.