0 votes

I have already made several attempts but do not manage. I want to create a report where I can select a user and then all the groups that start with XY are displayed. I have also tried with the report "Users' membership in groups" to display all groups of a user, but this does not work either, even if I reset the report. So how can I create such a report where I only have to select the user and then run the report and it will show me all groups that start with XY.

Thanks a lot

by (320 points)
0

Hello,

For us to help you with a solution, please, specify the following:

  1. What exactly do you mean by groups that start with XY? Is it that the report should only include the groups whose names start with XY?
  2. How exactly should XY be specified? Do you want it to be predefined in the script or selected by the user generating the report?
  3. Do you need to take into account only direct membership or also membership in nested groups?

Any additional details will be much appreciated.

0

helllo,

  1. report should only include groups whose names start with xy
  2. XY is predefined in the script
  3. also in nested groups

thanks a lot

1 Answer

0 votes
by (294k points)

Hello,

Thank you for the provided details. To achieve the desired, you need to create a report with a Directory object picker parameter. The report will execute the below script. The parameter will be used to select the user to output groups for. The report does not need a scope. For details on creating reports, see https://www.adaxes.com/help/CreateReport. In the script:

  • $searchValue - Specifies the value group names should start with to be included into the report.
  • $userParameterName - Specifies the name of the parameter used to select the user to generate the report for. The parameter name should include the param- prefix.
$searchValue = "XY" # TODO: modify me
$userParameterName = "param-User" # TODO: modify me

# Get user group membership
$userDN = $Context.GetParameterValue($userParameterName)
$user = $Context.BindToObjectByDN($userDN)
$groupGuidsBytes = $user.GetEx("adm-MemberOfGuid")

# Search parameters
$searcher = $Context.CreateGuidBasedSearcher($groupGuidsBytes)
$searcher.Criteria = New-AdmCriteria "group" -Expression {name -startsWith $searchValue}

# Generate report
$Context.Items.Add($searcher)

Related questions

0 votes
1 answer

I need to create a report of all enabled users in selected group or multiple groups. I am aware of the report named "Members of selected groups", but I don't know how to filter only enabled users. Is there a way to achieve this?

asked May 28 by gsoc.ssm (90 points)
0 votes
1 answer

I am trying to make a custom report that is basically the "Members of Groups" default report but instead of selecting Directory Objects, I want to select groups. The Members of ... will not work in Adaxes 2023 and later. I am running 2023.2 -- Suggestions?

asked Aug 13 by AvenuesRecovery (20 points)
0 votes
0 answers

When I run the above script after selecting groups the custom field "Group" is not showing one of the selected groups and not all of the groups are being reported ... 2 specific security groups are appearing and neither in one that was included in the search

asked Nov 18, 2021 by A_Pastor (70 points)
0 votes
1 answer

Every role-based-group starts with "arbg-" Users should only be in 1 arbg- group To enforce this, on any user change I would like to remove them from any "arbg- ... -Identity <SamAccount> | Select Name | Where-Object {$_.Name -Like 'ARBG*'}

asked Apr 29, 2022 by stevehalvorson (110 points)
0 votes
1 answer

Our Help Desk currently 'mirrors' the group membership of a new user based on another existing user in our AD. I'd like to be able to automate this so that the initiator ... and 'paste' it on the new user being created. Any help on this would be appreciated!

asked Apr 21, 2020 by RayBilyk (240 points)
3,588 questions
3,277 answers
8,303 comments
548,086 users