Active Directory Get Users In Group

Hi
I am trying to retrieve a list of AD members for a given AD Group.

Steps I have taken are
Setup the Active Directory Scope
Checked AD Group Exists which works OK.
Used “Get Users In Group”. This appears to want Group Distinguished Name so I got that using “Get Object Distinguished Name” using the AD Group Name as it’s input. I passed the result of that into the “Get Users in Group” activity input. But it only returns 1 member instead of multiple members.

Is what I have described above the correct way to do this?
Why does “Get Users in Group” ask for a Group Distinguished Name and not just the Group Name? I just want to say Give me all the members in an AD Group.

Any help appreciated as I just cannot get this to work.

I ran the Get-ADGroupmember command in powershell and it worked so I might have to try that in an invoke instead.

Thanks in advance for any suggestions
Andy

@andyc

ideally it would return an array with all members..can you check if youa re checking the correct group?

coming to setup you are on right track

cheers

Hi @andyc

Pls check below link , might be helpful.

Happy Automation

Hi, the group I am using does exist and is correct as I have checked in AD. The out variable is defined as a string array. It only returns one member (which does exist in the group) but I’m confused to why it does not return the other members. When I use PowerShell Get-ADGroupmembers it works. Any idea why I need to supply Distinguished Name and not Group Name?
I will look into Get-ADGroupmember in more detail I think.
Thanks
Andy

@andyc

you should use the group’s Distinguished Name in the Get Users in Group activity to get all members. The Group Name may only return partial results because it does not uniquely identify the group. You can find the Distinguished Name by using the Get Object Distinguished Name activity first. This ensures the activity retrieves the complete list of users.

For more:Activities - Get Object Distinguished Name
AND
Activities - Get Users in Group

What version of UiPath.ActiveDirectoryDomainServices.Activities are you using? I’d suggest trying different versions, could be a bug in a particular version.

I just tried the same thing with 1.6.1 and it properly returned all the users.

In your Active Directory Scope are you configuring Username, Password, Active Directory Server, and Port? I never do that, with AD you shouldn’t need to as any user (including the user the job is running as) should have permissions to read data from AD.

Hi
I am using “Get Object Distinguished Name” with then passing this result into “Get Users in Group” so I am giving it what it is asking for.

I did try entering no credentials into “Active Directory Scope” and that worked but no more of the full list returned :frowning:

I am running Active Directory 1.6.1. I will try dropping down a version if the library and see what happens.
Thanks for all the suggestions.
Andy