Let's talk about great in and managing groups we can use a group set of come and let's to create delete
modify or list Active Directory groups and either the group member said Come on lads or the 80 principle
group membership set up come on let's to add remove and least let members of an Active Directory group
by use only the group member come and lets you add or remove one or more users groups service accounts
and computers to or from a group whereas with the 80 principle group membership come and lets you add
or remove a user group service account or computer to offer on one or more group use add Desch 80 group
member.
But if you want to add to one object in too many groups use and there's a deep principle group membership
or you can ignore one or the other set of command left and to use Lupin to accomplish the same See system
in 80 years two types of groups are supported.
Security Groups and distribution groups and there are three score levels for each domain local global
local and universal.
To demonstrate how these come on let's work let's create in your group marketing users as a security
group was universal in scope and a Chapala of users to a group then we'll start to get a list of users
in the group by using both standard Windows power shell filtering and buildup filtering.
So creating a new group is is it and uses the same basic techniques as creating a new user.
The difference is there are far fewer properties and parameters to create a new group.
Let's create a new group with new this 80 group command will be using the following parameters.
Name description display name group category.
Group scope semicon name and pass through.
You can see the results of this command.
Notice that even though we didn't specify the full path where we wanted to create the market only users
group windows powar shell defaulted to put in the groups in the users container to override the default
specify the past parameter windows powar shelves will use the default container for your domain.
If you don't specify a path.
Now let's start.
Add in a couple of members to their account and user as a group we just created for this because we
are Add in multiple users to a single group we all use the at thus 80 group member on the left and it
has the following syntax is their identity parameter accepts a distinguished name or an ID security
identifier or SITD or same account name to identify which group you want to add members to the members
parameter accepts an array of new members that you want to add to the group.
The new member can be identified by the same methods as the group identifier but the parameter also
accepts.
Use a computer and group object variables that identify the members to be added.
You can not however pass objects to add to this Adey group member through the pipeline to it.
James and John to the market and users group use the following command at Desch A-D group member with
the following parameters.
Identity.
That will bear market and users and members that will be.
James and John and pass through parameter and you can see the output of this action to verify that the
members were added because their pass through parameter doesn't really really help with that.
Use the get this 80 group member command left.
So let's type get the group member identity marketing the users some votes about managing groups.
Let's take this a bit further and create another new security group for management.
We'll call the group managers and we'll use the description property to add members to the group.
So first create the group by use in your desk in the group or the following parameters.
Name description display name group category.
Group scope.
Same account name.
Pass through now we need to select just the users who are managers to get to the group.
We can do that by using the description property because we populated that when we created the users.
And we know it includes manager in the description for those who are managers.
This would be easy if we could just pass the results of get there say the user directly through the
pipeline to at this 80 group member.
But we can't.
So instead we'll create an array of semicon names from the results of get the user will call the variable
manager aere and do get the Assaidi use direction for this wearable with the following properties we'll
use filter to find the Vered manager and description.
Now we'll use the manager array variable was at there's a group member command.
So the command looks like this.
And finally to confirm the identity of who they added will use the following command.
Get the group member with the following properties identity members and we'll pipe it to ferment table
Orta and we'll format the table with some account name and name properties but that doesn't show us
that the users were added to manager.
So we could try changing that from a table command to the form from a table or to our same account name
name and description.
Unfortunately that just out puts a name to call on for the description field.
We can check why with the full on command.
Let's see what properties and methods are supported for.
Get this 80 group member and we can't add a property's description to the get 80 group member because
it doesn't support that parameter.
So instead we pass the results through get the user command which does support the properties parameter.
And now we get the following result with the following command.
Get say the group member and the broker just like these identity managers will pipe it to get their
say the user with the brokerages description and form a table with semicon name name and description.
And it worked.
Now we can clearly tell that each of the members so the managers group it just is described as a manager
in active directory.
But what we if we want to add a user to multiple groups at a time that's at John.
The same groups as James has.
So we'll add a wearable groups and get all the groups which James has got.
And at those groups to Joan Rivers and the principal group membership command.
Now John has the same groups as James does.
Now if we want to remove several groups from John we can do this with the following command removed.
Say the principal group membership identity John and leave the groups you want John to be in and of
course don't forget about pass through parameter.
Now let's get John's groups with get their say the user command.