Endless lessons we'll talk about creating and managing Ojos organizational units or we use our youth
to segregate groups of users computers or other objects in Active Directory without the overhead of
creating a whole new demand on them.
You can apply different group policies to different always use and have different possible requirements.
We can create and are you using the new dash a the organizational unit command let the command let parameters
can be used to set commonly used properties of o use such as display and a description and protected
from accidental deletion.
The only required parameter is the name parameter for properties that aren't covered by the command
let parameter displayed here.
Use the other attributes parameter.
There are other attributes parameter accepts a hash table with property name and property.
Well your parents.
There are three basic ways to use this.
80 organisational unit.
Create an overview by specifying all details so the command line grid know you from a template object
either the one you create or an existing or you or you use the c we filed to create multiple values
from a list of all use and properties to create a new engineer an overview for our control so dot com
domain use the following command.
Now there's a the organizational unit with the following properties name description display name protected
from accidental deletion path and pass through parameter.
Note that the path specified is actually the default path so we could have skipped that parameter.
And the same is true for the protected from accidental deletion parameter which defaults to true.
Because we use the pass through parameter the command or returning the form.
And we can tell then you engineer an O U is greater in the root of the control so that come domain 3.
Let's check it in Active Directory Users and Computers.
Here it is.
Now let's add computers and users to anow you now that we have an engineer an oh you should move our
engineer and the users and computers into that.
Oh you you might expect that there would be a move there's 80 user command left but there isn't.
And you might've been quite reasonably expect that you could use Surt.
There's a user with a past parameter to do the job.
But no the isn't a passed parameter and you can't move users that way either.
Let's try finding the necessary command in power shaggers get help command surrogate command will type
get command module active directory.
We will be using it for our move and will format table with command type and name cones from the following
result we don't need it move in server or server operation muster roll I guess we need move that 80
object as users and computers are just a form of active directory objects.
Let's start this command to see the syntax of this command.
It looks like what that what we need.
We need to specify the identity of the object we want to move and the Targett path we want to move it
to.
And it supports What-If parameter to make sure that it's going to do what we expect.
Now let's find a user or users who have engineerin in their description.
We'll do that with get Desch a user filter and description should be like engineering.
And we've got one user whose name is John.
Now we want to move John to engineering department.
Check if such a department exists in the form of oh you of course will try and find in this department
is God A.D. organizational unit command and filter parameter looking for engineering.
And as you can see the distinguished name is the target POS for our move.
So we'll use it.
Now we can move John to engineerin.
Are you with the following command.
First we'll get a user with filter engineering then pipe it to move the 80 object and the project pass
for moving will be the result of the Folarin filter and will use What-If parameter to see what will
happen when we run the following command to be sure that everything will go smoothly.
It looks like it will have a success so we remove the what leave and issue the command again but now
real issue that we pass through parameter because the command is silent and we won't see any results
if we don't specify pass through parameter.
Now let's get that shady user really identity John and we can see that he is a member of engineering.
All you can say from distinguished name property which is shown in the output.
Now we can move Jon's desktop over to the same for you.
But first let's find his desktop.
We know that his desktop go out and aim client 1 or just client in his description.
So let's get this 80 computer and filter that we are looking for client in description.
Now we can simply specify the identity of the computer we want to move move this way the object accepts
the distinguished name or D and or use your ID for their identity parameter or the result of that.
Does the user get this group or get Desch a computer and even get this service account get Desch the
organizational unit or get Does 80 fine grain parts for policy.
So any of these results could be used for more than an object in Active Directory.
We have got both the distinguished name and the do id in the output from the get.
There's a computer.
So we just can't copy and paste this result to our command and the command looks like it moved the object
Now the following parameters identity Targett paths and pass through parameter we move just a single
user enters single computer but you can use it to move conduits or even thousands of users.
But always remember that you have to check your work before committing large changes that will affect
many users.