1 00:00:00,340 --> 00:00:07,640 Add in members to a group in the previous lessons with so how to create groups an Active Directory. 2 00:00:07,770 --> 00:00:13,130 How to search for them and how to change group object information. 3 00:00:13,200 --> 00:00:16,880 Groups are useless without members in them. 4 00:00:16,970 --> 00:00:25,910 And this lesson will concentrate on how to add both user accounts and computer accounts to security 5 00:00:25,920 --> 00:00:33,420 groups and Active Directory like any other operations Active Directory module has a command led to add 6 00:00:33,480 --> 00:00:41,970 members to groups they get a group member command lab does this for you to add a member to the group 7 00:00:41,970 --> 00:00:47,560 you add a group member command led with a member parameter. 8 00:00:47,610 --> 00:00:54,480 Use the same account name of the member or user for reasons of addition. 9 00:00:54,480 --> 00:01:02,040 Add in a single user account to a security group is very straightforward with the ad there's a group 10 00:01:02,040 --> 00:01:05,910 member command led as shown in the following command. 11 00:01:06,180 --> 00:01:09,240 We can run and we can run it at a D. 12 00:01:09,240 --> 00:01:12,150 Group member identity. 13 00:01:12,150 --> 00:01:17,750 We have to specify the group to which we are adding the user. 14 00:01:17,790 --> 00:01:20,080 In my case it's Group 1. 15 00:01:20,110 --> 00:01:23,970 Is read in quotes and members. 16 00:01:23,970 --> 00:01:31,650 In this case it's only one member club user one multiple users can be added to security groups by passing 17 00:01:31,650 --> 00:01:37,430 their names to the members attribute as shown in their follow in command. 18 00:01:37,470 --> 00:01:39,800 Let's run it at the ADA. 19 00:01:39,810 --> 00:01:48,810 Group member identity group 1 Read and members will add lap User 1 2 and 3 to this group. 20 00:01:48,960 --> 00:01:56,520 But if you want to add a single user to multiple groups at the same time this could be achieved also 21 00:01:56,520 --> 00:02:01,710 by using the following command to specify the groups like task group. 22 00:02:01,710 --> 00:02:06,820 Group 1 The Shred pipe it to the following command 4 reach. 23 00:02:06,870 --> 00:02:11,190 Do this action add a group member. 24 00:02:11,190 --> 00:02:19,670 Identity is taken from the previous part of this command from the part before the pipe. 25 00:02:19,680 --> 00:02:26,280 In my case it's test group and group one this read and we are read in the members. 26 00:02:26,280 --> 00:02:29,580 In my case it's only one member LEP user 3. 27 00:02:29,580 --> 00:02:36,780 So once again the precedent command will add the lap user 3 user account to the test group and group 28 00:02:36,780 --> 00:02:38,350 dest read groups. 29 00:02:38,370 --> 00:02:46,140 Here we pass group name to the identity parameter of the ad a group member command led one after the 30 00:02:46,260 --> 00:02:49,370 other to add lap user 3. 31 00:02:49,490 --> 00:02:58,230 One of the common use cases for system administrators is that they will have a list of users to be added 32 00:02:58,590 --> 00:03:02,360 in a text file when you have such a requirement. 33 00:03:02,370 --> 00:03:08,550 Add in the users to a specific group is as simple as the following command. 34 00:03:08,550 --> 00:03:16,920 We add a new variable which is called user base and which is equal guard content command led and we 35 00:03:16,920 --> 00:03:25,980 are getting the content from the file we specify in my case it's users that Steve file which is located 36 00:03:26,310 --> 00:03:35,970 on C drive in P S folder and after that we run the following command at a group member of the group 37 00:03:35,970 --> 00:03:45,000 to which we read and so identity as test group and members whom we are read into this group and we are 38 00:03:45,000 --> 00:03:50,600 using the variable we have added before users wearable. 39 00:03:50,610 --> 00:03:58,260 Now let's see how to add all user from an organizational unit to a security group by using the following 40 00:03:58,260 --> 00:03:59,250 command. 41 00:03:59,250 --> 00:04:02,530 Again we are red and wearable users. 42 00:04:02,640 --> 00:04:11,660 We are getting all Active Directory users from lap organizational unit so the command looks like that 43 00:04:11,670 --> 00:04:15,480 get this a user search base. 44 00:04:15,480 --> 00:04:19,790 The path to the O you we are getting users from. 45 00:04:19,950 --> 00:04:28,140 Then we are filtering the results with a filter parameter and we have filter and by the following property 46 00:04:28,260 --> 00:04:33,730 object class which should be equal to a user and we run the following command ad. 47 00:04:33,840 --> 00:04:42,690 There's a group member identity test group and members is taken from the variable user. 48 00:04:43,230 --> 00:04:50,730 So the first line in this code will query all users and give given organizational unit and store the 49 00:04:50,730 --> 00:04:59,570 details in the user wearable the same variable is passed to to the members parameter of the ADA. 50 00:04:59,860 --> 00:05:02,920 Member command led in the second line. 51 00:05:02,920 --> 00:05:05,230 This kind of additional command lattice. 52 00:05:05,230 --> 00:05:14,080 Useful if you have an o you structure based on departments buildings and offices and you want to add 53 00:05:14,110 --> 00:05:22,480 to all the sales users for example to one security group or all the users in the same building to another 54 00:05:22,480 --> 00:05:24,940 security group and so on. 55 00:05:24,940 --> 00:05:32,620 Similarly you can copy members from one security group to another by following a simple command the 56 00:05:32,620 --> 00:05:34,480 command looks like this. 57 00:05:34,480 --> 00:05:42,440 Again we are ready and members variable which is equal to get a group member identity task group. 58 00:05:42,490 --> 00:05:47,380 Another line is at a group member identity test group. 59 00:05:47,380 --> 00:05:52,760 Thus copy and members is taken from members variable. 60 00:05:52,840 --> 00:06:00,580 The first line reads the membership details of the test group security group and store it in a variable 61 00:06:00,910 --> 00:06:10,270 then the same variable is passed to the HDD sorry at does a group member command led to add members 62 00:06:10,270 --> 00:06:13,870 to a new security group which is called test group. 63 00:06:13,870 --> 00:06:19,570 This copy here you should know that the target group should be created beforehand. 64 00:06:19,570 --> 00:06:24,780 If you haven't created the target group the operation will fail. 65 00:06:24,790 --> 00:06:32,680 Now let's check the results of these commands in active directory user centered computer console to 66 00:06:32,680 --> 00:06:35,260 see it in graphical user interface. 67 00:06:35,290 --> 00:06:41,470 So let's open Active Directory Users and Computers find their group. 68 00:06:41,470 --> 00:06:47,710 Group one which was used in the first example and see the members of this group. 69 00:06:47,810 --> 00:06:50,650 Lap User 1 should be here. 70 00:06:50,650 --> 00:06:58,380 The second example was adding three users to this group and as you can see all users are here as well. 71 00:06:58,380 --> 00:07:01,860 Lib User 1 lap USER 2 and lap user 3. 72 00:07:01,900 --> 00:07:09,190 We also added lap user 3 to test group and group 1 dash read. 73 00:07:09,310 --> 00:07:12,550 So let's find test group and check. 74 00:07:12,550 --> 00:07:18,720 Members of this group as you can see lap user 3 is here as well. 75 00:07:18,740 --> 00:07:26,910 He also populated this group with the members from users Dota 2 file and all of them are here.