0 votes

Hi support,

We have security groups named like Test-Group--Users, where is different for each group.

<br> I have a powershell query which gets a list of those Test-Group--Users" that user is part of

<br>

Get-Aduser -properties Name,SamAccountName,Department,co,MemberOf | Select Name, Department, @{n="Test Groups";e={((@($_.memberof.split(",")) -replace "CN=") -like "Test-Group-*") -join ","}}

I am trying to achieve this using Column in Adaxes but not sure how to proceed after this

$User = $Context.GetADObject()
$UserMemberOf = $User.Get("memberof")

#How can I iterate through memberof values in Adaxes scripting
$Context.Value = $UserMemberOf 

Would appreciate any help with this. Thank you

Update I got a bit closer with this

 $User = $Context.GetDirectoryObject()
$UserMemberOf = $User.Get("memberof")
$req = $UserMemberOf.where({$_ -like "CN=Test-Group-*"})
$Context.Value = $req[0] 

But $req contains only Test-Group-<variable>-User that user is member of but it is an array

ago by (420 points)
edited ago by

Please log in or register to answer this question.

Related questions

0 votes
1 answer

Hello, I have a report of computers in multiple groups that I used to create a chart count of "Computers" in certain security memberships relating to agent software. ... a member of the group written in the script. Any assistance is appreciated. Thanks!

asked Nov 7, 2023 by Edogstraus00 (490 points)
0 votes
1 answer

I am trying to restrict which users can be added to groups. In the web configurator how can I add a criteria to restrict the users available to select are only from a ... account has to be enabled but restricting to certain OUs is what I cannot figure out.

asked Jan 19, 2023 by techg (320 points)
0 votes
1 answer

We have RBAC groups inside an OU. We would like to restrict users from being added to multiple RBAC groups at a time. For example: RBAC Roles OU Sales RBAC Group ... groups outside of this OU structure though. What's the best way to achieve this? Thanks

asked Oct 13, 2021 by bavery (250 points)
0 votes
1 answer

Hi there, I am trying creating a report in Adaxes a set of users and looking to add a few group names as column with value 'Yes' or 'No' based on if user is member of ... Value = "Yes" } else{ $Context.Value = "No" } Would appreciate any help in this aspect.

asked May 6, 2022 by Vish539 (420 points)
0 votes
1 answer

We're delegating admin rights to our various IT departments, only giving them access over their stuff under their OUs. They're missing the option to see the group membership ... on user's management history, is there another approach that I'm not aware of?

asked Sep 18 by felix (150 points)
3,528 questions
3,218 answers
8,200 comments
547,635 users