1 00:00:00,450 --> 00:00:07,470 Now let's talk about enabling or disabling computer accounts as a system administrator it's required 2 00:00:07,470 --> 00:00:13,620 to keep your Active Directory database clean tidy and minimal in size. 3 00:00:13,620 --> 00:00:23,480 Also one must adhere to the security policies of the organization and often needs to reconcile computer 4 00:00:23,480 --> 00:00:31,890 accounts data monthly quarterly and annually in accordance with those security policies. 5 00:00:31,890 --> 00:00:36,920 LICHTMAN Let me use here is not specific to computer objects. 6 00:00:36,930 --> 00:00:43,610 It can also be used for an Active Directory user computer or service accounts. 7 00:00:43,710 --> 00:00:51,750 So we could use the following command to enable a particular computer get the shady computer they're 8 00:00:51,750 --> 00:01:00,360 looking for the computer with identity computer one for example or some other computer and pipe it to 9 00:01:00,630 --> 00:01:09,060 enable the ADA account common land to enable multiple computer accounts you can use filters in conjunction 10 00:01:09,060 --> 00:01:13,380 with get this a computer or search area account. 11 00:01:13,380 --> 00:01:21,090 Come on lets the follow up command will search for computer accounts inside the given o you and it will 12 00:01:21,180 --> 00:01:23,170 enable all of them. 13 00:01:23,220 --> 00:01:31,610 Let's review that that command get a computer and we'll be filtering on the following criteria. 14 00:01:31,740 --> 00:01:42,120 We'll be looking for all the computers in these all you so storage base parameter is to look for the 15 00:01:42,120 --> 00:01:46,580 following computers in the following or you container. 16 00:01:46,710 --> 00:01:56,580 In my case it's computers it's SOP or you of production or you in contrast a dot com domain and the 17 00:01:56,580 --> 00:02:06,030 results which will get will pipe to enable does ADR account command let which will enable all these 18 00:02:06,030 --> 00:02:14,280 computers in the following Oh you pass through parameter will show us the results the output of this 19 00:02:14,280 --> 00:02:24,890 command similarly to disable computer accounts just replace enable Ada account with the disable idea 20 00:02:24,890 --> 00:02:32,940 account command let the following command disables all the computers inside the given oh you again will 21 00:02:32,940 --> 00:02:41,850 you then get a computer filtering all the computers in the computers or you riches and production or 22 00:02:41,850 --> 00:02:47,850 you and by the results to disable the account command left. 23 00:02:48,000 --> 00:02:56,910 Of course remember about explore and more by referring to the help content of this command lets you 24 00:02:56,910 --> 00:03:05,580 could always run the following command get help get a computer detailed or examples or online whatever 25 00:03:05,580 --> 00:03:11,330 property you need right now some words about deleting computer accounts. 26 00:03:11,430 --> 00:03:19,470 As we've discussed in previous lessons as a system administrator one must adhere to the security policies 27 00:03:19,800 --> 00:03:28,370 of the organization and keep their Active Directory database clean and tidy as part of this process. 28 00:03:28,380 --> 00:03:37,950 You might want to delete stale or fly computers objects from Active Directory we could use the following 29 00:03:37,950 --> 00:03:47,520 simple command to delete a computer account remove there's a computer identity computer one the most 30 00:03:47,520 --> 00:03:57,440 common use case is search for computers older than some quantity of days for example older them 30 days 31 00:03:57,510 --> 00:04:05,370 or some other quantity and removing them from your active directory you can achieve this using the following 32 00:04:05,370 --> 00:04:15,120 command will add a new variable with the name computers which will be equal to get an all computers 33 00:04:15,420 --> 00:04:23,030 which have the following properties last log on date and type it to the following request. 34 00:04:23,100 --> 00:04:32,700 So the last log on date should be later than 10 or 20 or so two days so the following example searches 35 00:04:32,790 --> 00:04:41,280 Active Directory for computers that are not reached in the last 30 days and stored them in a variable 36 00:04:41,580 --> 00:04:50,310 later in case we can pass the variable to the remove Ada computer command led to delete them by default 37 00:04:50,340 --> 00:04:58,190 this command light will prompt you for each deletion you can overwrite it using the conform parameter 38 00:04:58,230 --> 00:04:59,550 was false. 39 00:04:59,590 --> 00:05:02,190 Up with remove the computer. 40 00:05:02,200 --> 00:05:09,900 Come on let to do it multiple computer accounts that have location well you're set to for example office 41 00:05:09,900 --> 00:05:12,340 one you can use the following command. 42 00:05:12,480 --> 00:05:22,860 Get a computer filter them by location which is equal to office 1 and 5 the results to remove a computer 43 00:05:23,130 --> 00:05:28,640 command led with confirm parameter which is equal to False. 44 00:05:28,860 --> 00:05:36,660 If you want to remove all computer recounts in particular or you could do the following code go to the 45 00:05:36,660 --> 00:05:39,080 computer storage bays. 46 00:05:39,240 --> 00:05:45,190 We'll be looking in the following Oh you in my case it's disabled computer. 47 00:05:45,360 --> 00:05:55,740 Oh you and pass these results to pipe this results to remove a computer command lab with conform set 48 00:05:55,740 --> 00:05:57,990 to false property. 49 00:05:58,050 --> 00:06:05,100 This examples will help you to get started for instance you can use either get a computer command led 50 00:06:05,400 --> 00:06:13,980 to search computer accounts used on different veterans and pass them to the remove a computer command 51 00:06:13,980 --> 00:06:15,210 led to delete them.