Now let's talk about enabling or disabling computer accounts as a system administrator it's required
to keep your Active Directory database clean tidy and minimal in size.
Also one must adhere to the security policies of the organization and often needs to reconcile computer
accounts data monthly quarterly and annually in accordance with those security policies.
LICHTMAN Let me use here is not specific to computer objects.
It can also be used for an Active Directory user computer or service accounts.
So we could use the following command to enable a particular computer get the shady computer they're
looking for the computer with identity computer one for example or some other computer and pipe it to
enable the ADA account common land to enable multiple computer accounts you can use filters in conjunction
with get this a computer or search area account.
Come on lets the follow up command will search for computer accounts inside the given o you and it will
enable all of them.
Let's review that that command get a computer and we'll be filtering on the following criteria.
We'll be looking for all the computers in these all you so storage base parameter is to look for the
following computers in the following or you container.
In my case it's computers it's SOP or you of production or you in contrast a dot com domain and the
results which will get will pipe to enable does ADR account command let which will enable all these
computers in the following Oh you pass through parameter will show us the results the output of this
command similarly to disable computer accounts just replace enable Ada account with the disable idea
account command let the following command disables all the computers inside the given oh you again will
you then get a computer filtering all the computers in the computers or you riches and production or
you and by the results to disable the account command left.
Of course remember about explore and more by referring to the help content of this command lets you
could always run the following command get help get a computer detailed or examples or online whatever
property you need right now some words about deleting computer accounts.
As we've discussed in previous lessons as a system administrator one must adhere to the security policies
of the organization and keep their Active Directory database clean and tidy as part of this process.
You might want to delete stale or fly computers objects from Active Directory we could use the following
simple command to delete a computer account remove there's a computer identity computer one the most
common use case is search for computers older than some quantity of days for example older them 30 days
or some other quantity and removing them from your active directory you can achieve this using the following
command will add a new variable with the name computers which will be equal to get an all computers
which have the following properties last log on date and type it to the following request.
So the last log on date should be later than 10 or 20 or so two days so the following example searches
Active Directory for computers that are not reached in the last 30 days and stored them in a variable
later in case we can pass the variable to the remove Ada computer command led to delete them by default
this command light will prompt you for each deletion you can overwrite it using the conform parameter
was false.
Up with remove the computer.
Come on let to do it multiple computer accounts that have location well you're set to for example office
one you can use the following command.
Get a computer filter them by location which is equal to office 1 and 5 the results to remove a computer
command led with confirm parameter which is equal to False.
If you want to remove all computer recounts in particular or you could do the following code go to the
computer storage bays.
We'll be looking in the following Oh you in my case it's disabled computer.
Oh you and pass these results to pipe this results to remove a computer command lab with conform set
to false property.
This examples will help you to get started for instance you can use either get a computer command led
to search computer accounts used on different veterans and pass them to the remove a computer command
led to delete them.