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 (200 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 (267k 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
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 (90 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 (230 points)
0 votes
1 answer

Hi Guys, Short question. In our organisation we have a buch of the security group that have a specific "class". The class is simple number stored in the ExtensionAttribute1. I'd ... tried to do the something like that with ADSI :cry: Could you please help me?

asked Dec 8, 2014 by axmaster (510 points)
0 votes
1 answer

For security purposes, we need to audit the objects that are capable of replicating the directory. As we have a number of individuals that need this report, I would like to ... four domains and would like to see any objects with this permission in any of them

asked May 20, 2022 by jiambor (1.2k points)
3,293 questions
2,991 answers
7,664 comments
544,194 users