Add in one group member to another in previous lessons we saw how to teach you the recounts and computer
accounts for security groups by your Active Directory.
Come on let's.
Another common Active Directory operation related to security groups is add in one security group to
another security group.
This is done for reasons of management of permissions and memberships before proceeding to see how groups
can be nested.
Let's first understand what type of scope of groups can be added to a given security group.
Mazhar this you might run into errors such as in this example and to start thinking what is wrong.
So let's run this command and try to add one group to another.
They've got gotten narrower and if you read the error message carefully it clearly states that a local
group can not be a member of a universal group.
It is good to know these things before attempting to enter a group in another group.
You can read more about the different security group types and to the membership details.
But in short universal group can be called Global and universal groups from any man in the same forest
as members of a global group can hold other global groups from the same forest and to the local group
can hold global groups from any domain including trusted universal groups from the same forest domain
groups from the same domain and global and universal groups from other forests.
No let's add two groups free to terrorist group.
Now if we haven't got a narrower and test group three can be freely nested into test group.
This command had a group named Test Group 3 to test group.
If you notice they are not provide in any group scope information at the time of adding the command
left will automatically calculate the group's sound.
If the addition is not supported it will throw arrows.
Otherwise the execution should get completed without any errors.
We can check all the users and computers so we'll find the test group and check its members and we can
find test groups 3 here and see that it was successful it added.
What about Baalke groups creation as a resource another the example of an Imbolc users their computer
account or group security groups can be added in bulk as well.
For this demonstration we can use the following code.
We can create for example for security groups and Active Directory so that you can add them to a new
security group in Balkh create Imbolc groups is very easy.
If they share a similar name and convention as shown in this code so we are creating the groups from
1 to 4 and for each group will give a name Child group and a number from 1 to 4 and will add to this
group to Active Directory is its name.
The scope will be the domain local and the password.
These groups will be located as groups in production all you.
So running this code will create four groups with the name Child group 1 2 4 and 2 still do this operation
in seconds.
Now we can add this newly created groups to add security in our security group as members.
First let's create a group to which we want to add this newly created four groups as a result before
a group can be created by using the new dash A-D group command left the following command will create
the parent group one security group.
So let's Reinard we on you.
Does the group Desch name parent group 1 and the scope for it will be Domain Local.
Once the group is created we can add to the newly created for child groups to this parent group while
I'm using the following command I will add a variable which will be called Groups and equal to get a
group filter in all of the groups which contain child group in its name and then reparse This able to
follow and command out there's a group member we are read in groups too through this group which is
called parent group 1 and the groups which we are adding is taken from groups variable which we've created
before.
So the first line of the code will search left active directory for any group that has a name starting
with child group and strong it's the details and the groups variable once the details are available
they can be added to another security group parent group want to use in the address the group member
command loud and the groups will be added.