So in this video, first we were looking at the groups and will be retrieving the group information
using this feature.
So let's net group domain admins and here can see we have one user administrator when I go to add to
their users and computers.
And so right.
Work on this between admins.
So this is a member of administrator and this one.
And if you go to the members and you can see along with the administrator, there is a group called
upon.
Whenever I go to the Commander Group, I don't see that one group here.
So what happens is to only fetch the users from this list.
And also in this group, you should click on this, go to the members and you can see there is another
group nested upon and there is a user Pashtu.
So if you own that user, then your directory, the Roman admin and directly this nested pun and you're
going to see the members just one.
And if you bother to share this information, we're not using the net group.
You can also use the power view and you need to pass the recorder to optional.
Yes.
So you need to do some extra effort to find all of these groups.
So in this video will be using the Sheesha to get all of the nested groups and users as well.
So if I switch right, the function that is accessible to the members of the class and that is why we
are just printing out the value.
So not any return type.
So get our members.
So the first alphabet should be character.
That is the convention in the future.
And the first string I want to first argument is that it's a group name.
So we'll be putting the group name and the second argument as that domain name.
So we'll be using the function called group.
Before that, we'll be importing all of this namespaces.
First one is buried reserves.
This production management and second one inspectors are revert back to but deferred.
These are not important.
Right click on the product and go to their reference.
So in this reference, check the checkboxes for the corresponding add order to the resource and cannot
get.
So here we go.
So take on this and click on target.
Now you can import these names business not.
And so there is group principal dot find by identity.
So group inspired.
Defined by identity.
We'll find by the group name by that given spring.
So the first argument has been the context on which context to find.
We need to find both the main and second one in the spring when the group name you want to find.
So before that, we need to make one principal context object.
Let's say a piece equals two new principal context.
Now, if you hold control and click on this, there are a few constructors you can pass.
The principal context of context type.
So we'll be choosing the context type.
But between for this and the string name and the container is the name of the puzzle.
You can also
just again pass the username and password as well, but we'll be just running the XY on the machine
directly under your domain user command prompt.
So I will be just passing the first one context type.
DOT.
And you can see there are three options application territory and domain.
This is a radius, so we'll be choosing this one.
And the second one is the domain name.
That is spec section and that is my domain.
Since we have posted this value in the domain name argument so we can just say domain name, you should
have my position under.
Now depends what context object is ready.
You can pass this object to here and from this store.
Search for the winner advance.
Roman at Windsor Castle.
This, in case you intend to do so, you can also pass as my audience.
MARTINEZ But since we're watching the group name, I'm just building this let's a group name and return
date we can hold on to this group identity and the return type is groupings but there a groupings per
object.
Okay.
It's said group principal GP is equal to group principal object.
Now you need to find what are the methods available in this GP so GP Dart and here you see the context.
You will get this context and discipline them, distinguishing them so you get the group information
as well.
So one important function we are focusing is get members and if you hold on to this button and baby's
principle search results so it's there stare at it so you can look using the forage principle group
in group GP that numbers so this get members will get all the members including the user and the group
so we can just say group that so here you can see that description display name listing issue and then
we can also put into the food issues them see in our booth this year.
And you can also get groups for this group as well.
So first, let's just print their name.
And be providing the and arguments to this program.
So first one is a group name which is provided by the first argument.
It's our zero.
That is the first argument and domain name.
So in other programming languages, the first argument is file name.
But here the first argument is also dialogue and we need to create.
So here this is the class one.
We have functions that is get our and the main function we need to create object of class.
Class one and we'll be calling this our members.
So to take class one CS equals to new class.
So we are declared object.
When I say a C that you can see here the members that are members.
That is the function and you need to pass.
Group name.
Common domain name.
So this will go and pass the group member whenever name values for this.
Get our members and we'll be finding the group by the group name in the context of this domain.
And we will printing this name for no.
Let's build the solution.
So let's copy this.
You can also right click on this product and click on this open for Forex photo.
So that group that you sexy and domain admins and tacticians and not local.
Okay.
So you can see administrator and you know, you can see the point, but you don't know whether it is
the person, is the user or the group.
So what you can do is you can print out the type of this object.
So if there is one group that is structured structure object, sorry, so group but structure object
returns whether it is user or group, if it's user.
Now we can just say.
User.
Oh, that's a bad name.
So we are just printing this as a username.
So let me read this one.
Are we going to see if a group about structure objects is equal to group?
And then.
You know, printing.
Group.
So let's build this one.
And now you can see we've got the user group.
Now, what we need to find is are the members of the group and all are the members are the group of
this group.
So you need to find recursively at the end of the tree.
So what you can do is after printing this, you can call the same function that are members here.
So this is the call recursion.
You get all members off.
Now you need to pass the group name.
So the group name is the group that name.
And the second one is normal domain name, which is a constant.
So first will be finding the groups of domain admins.
And if there is any other group in this domain that means group, then we will finding again the members
of the group.
That is point.
So let's go.
And.
And this one I know you can see me have Groupon and user tissue and the group next to the bond and the
user test one.
But there is a slight confusion.
We don't know whether this is testes, number of bond or something.
So what we can do is we can print the parent group from here so we can say a user.
So then say.
GREENE He's a member of.
So the group that name is the current charity group and this group name is the parent group.
Group name.
So they should be fine.
Let's build a solution and copy here.
And here you can see.
Oh, User Administrator Groupon is memorable domain admins and the push to start a Barneys monograph
contest.
One sort of torso.
Martha This user is member of one.
So this is the ah, it's a group name.
So they should do fine.
And now we can see we got all the users and the groups you can see.
Username is also a member of the group, so this gives you perfect clarity of what are the users present
and users in the groups present under that particular group.
So it's a remote desktop users and there is only one user that is attached to member of my desktop business.
So that's it for this video.
So you need to enumerate everything you order to leave a smart piece of information also.