1 00:00:06,470 --> 00:00:11,890 In this lesson we'll talk about modifying the user properties and the previous lesson. 2 00:00:11,890 --> 00:00:19,820 We've seen how to create user accounts use an Active Directory power show module and Active Directory 3 00:00:20,180 --> 00:00:22,040 administrative center. 4 00:00:22,070 --> 00:00:29,900 The task of system administrator will not and just by creating user objects in Active Directory they 5 00:00:29,900 --> 00:00:34,250 will also be responsible for modifying and managing them. 6 00:00:34,250 --> 00:00:40,690 This lesson will help you to understand the process involved in modifying the user accounts using power 7 00:00:40,690 --> 00:00:41,250 shell. 8 00:00:41,390 --> 00:00:48,370 Since modifying user accounts has a very big scope we'll discuss a few examples. 9 00:00:48,440 --> 00:00:53,990 Example cases where a bulk user modification is required. 10 00:00:53,990 --> 00:00:58,590 These examples will help you to understand the modification process. 11 00:00:58,640 --> 00:01:06,830 You can leverage these examples to modify any other attributes in Active Directory like updating the 12 00:01:06,830 --> 00:01:15,770 description of a user object updating the telephone number of multiple users enabling or disable user 13 00:01:15,770 --> 00:01:23,330 accounts in bulk moving user accounts to another you before starting to modify user properties. 14 00:01:23,330 --> 00:01:31,260 Let's brush up on the basics with graphical user interface to update the description of a user account. 15 00:01:31,400 --> 00:01:41,390 You'll typically follow the steps open Active Directory administrative center to search for for a user 16 00:01:41,390 --> 00:01:43,540 name in Active Directory. 17 00:01:43,610 --> 00:01:50,900 Go to the properties of the object and update the description and save your changes by clicking on a 18 00:01:50,900 --> 00:01:51,610 kid. 19 00:01:51,620 --> 00:01:57,980 What happens under the scenes when you update the description of the object and save it. 20 00:01:57,980 --> 00:02:03,910 The system rewrites the value to the respective attribute of that user object. 21 00:02:03,980 --> 00:02:12,800 You can view all attributes and their values using the attribute editor tab in Active Directory administrative 22 00:02:12,800 --> 00:02:16,900 center or Active Directory Users and Computers. 23 00:02:17,000 --> 00:02:23,900 Of course you can also use Ada as I added that MSE tool for those purposes. 24 00:02:23,930 --> 00:02:32,970 So let's find some user with a name Tom and to view his attributes details in attribute editor. 25 00:02:33,560 --> 00:02:37,400 So in order to update in India tales of a user object. 26 00:02:37,400 --> 00:02:42,910 First we need to know its attribute name or display name and also all this. 27 00:02:42,920 --> 00:02:51,170 Remember that the names for properties you see and graphical user interface tools might not be the same 28 00:02:51,260 --> 00:02:54,200 as what you're seeing the attribute editor. 29 00:02:54,200 --> 00:03:02,140 For example the first name field you see in graphical user interface is translated to a given name in 30 00:03:02,150 --> 00:03:03,950 the attribute editor. 31 00:03:04,040 --> 00:03:12,540 Similar to the goofy approach we can search for a user object and list its attributes using power shell 32 00:03:12,560 --> 00:03:18,860 with get Dash 80 user command led and we can add filter. 33 00:03:18,890 --> 00:03:29,590 For example we can type get a user filter parameter and we'll filter it by name which is equal to Tom. 34 00:03:29,600 --> 00:03:37,550 This will return the user object with the name attribute having the value of Tom by default it will 35 00:03:37,550 --> 00:03:40,900 return only a basic set of attributes. 36 00:03:41,000 --> 00:03:48,980 If you want to see all the attributes of this user object then specify the property parameter so let's 37 00:03:49,130 --> 00:03:57,950 add to this command property parameter and we'll be looking for all the properties of this user. 38 00:03:57,950 --> 00:04:03,800 The wildcard for all the properties as you might remember is asterisk. 39 00:04:03,800 --> 00:04:07,490 You can also query users matching their name. 40 00:04:07,490 --> 00:04:16,700 In that case you can add asterisk to the filter you've used before like Tom and asterisks will find 41 00:04:16,760 --> 00:04:20,480 all the users which are starting with Tom. 42 00:04:20,480 --> 00:04:29,520 Similarly you can query all objects inside a particular organizational unit by passing the or you distinguished 43 00:04:29,540 --> 00:04:32,980 name to their search based parameter. 44 00:04:33,080 --> 00:04:42,200 So we could type get user filter parameter asterisks search based parameter and we'll be looking in 45 00:04:42,550 --> 00:04:43,140 lab. 46 00:04:43,220 --> 00:04:52,590 Oh you you might have another oh you so you have to change this address which are suitable to your environment. 47 00:04:52,640 --> 00:05:00,200 Now when we know how to search for objects let's move on to learn how to modify them updating the description 48 00:05:00,200 --> 00:05:03,050 of a user object is not that hard. 49 00:05:03,080 --> 00:05:08,880 Let's use that for Tom object which we have found before. 50 00:05:09,150 --> 00:05:19,560 So we could create a variable which will be called Dollar character user OBJ which is for user object 51 00:05:19,920 --> 00:05:31,100 and it will be equal to get thus a user with filter by name which is equal to Tom and properties will 52 00:05:31,140 --> 00:05:35,890 be looking for for all properties of that user object. 53 00:05:35,910 --> 00:05:44,010 We can also now view the current description of the user object by using the following command the variable 54 00:05:44,010 --> 00:05:53,160 user OBJ dot description assuming that the user account has a description set to replace the current 55 00:05:53,160 --> 00:05:55,380 description with a new value. 56 00:05:55,380 --> 00:06:00,790 First we need to understand what data type this attribute will accept. 57 00:06:00,930 --> 00:06:03,590 As you might remember we can find this out. 58 00:06:03,600 --> 00:06:06,870 You then get type method. 59 00:06:06,870 --> 00:06:15,060 You can invoke this method as shown in the following command variable User object the description that 60 00:06:15,150 --> 00:06:23,790 get type in brackets the output of this command shows that it accepts data types driven so to update 61 00:06:23,790 --> 00:06:26,340 the description to a new value. 62 00:06:26,400 --> 00:06:27,990 We need to use the set. 63 00:06:28,060 --> 00:06:37,740 Is a user command led and passed the user object wearable to the identity parameter and the string that 64 00:06:37,740 --> 00:06:43,120 you want to set in the description field to the description parameter. 65 00:06:43,140 --> 00:06:48,550 We have this command and this command will return to the power shall prompt him. 66 00:06:48,660 --> 00:06:57,900 Power shall render if it completes without any errors so the command looks like that set a user with 67 00:06:57,960 --> 00:07:06,810 identity parameter which is user object variable description parameter which is the new description 68 00:07:07,150 --> 00:07:14,850 will be modify and so in quotes we have to add a new description and to verify if the new description 69 00:07:14,850 --> 00:07:22,200 is updated and the user description field we can either check it through the graphical user interface 70 00:07:22,200 --> 00:07:30,030 or wrong the power shall command that we used for querying the user object in the preceding commands. 71 00:07:30,240 --> 00:07:38,190 So putting everything together the following code will update the description of a given active directory 72 00:07:38,190 --> 00:07:47,340 user first will set the variable user name then will set and other wearable new description which will 73 00:07:47,340 --> 00:07:50,230 be equal to some string. 74 00:07:50,520 --> 00:07:58,920 We also at user object wearable which will be equal to get the user with filter and properties. 75 00:07:58,920 --> 00:08:07,020 We could also use right host to get the car and description of the user object and after that we set 76 00:08:07,050 --> 00:08:17,010 new description with set the user identity will be equal to the variable User object and a description 77 00:08:17,010 --> 00:08:24,780 parameter which will be equal to new description variable which we have added before and now we could 78 00:08:24,900 --> 00:08:28,860 get the user and check the new description. 79 00:08:28,860 --> 00:08:36,390 So we do that with a new variable User object or in my case it's the same variable which I've used before 80 00:08:36,660 --> 00:08:41,540 which is equal to get the user fill turn by name. 81 00:08:41,700 --> 00:08:51,120 User name and its properties and we could output it to the screen and see the new description of the 82 00:08:51,210 --> 00:09:00,890 object in such a way you can update valence of any other attribute in the procedure shown in this code. 83 00:09:01,020 --> 00:09:07,680 So you could try updating for example the display name of a user for your practice.