0 votes

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?

by (90 points)

1 Answer

0 votes
by (280k points)
selected by
Best answer

Hello,

Do we understand correctly that you need the report to only include members of the selected groups that are of the User object type and eliminate members of other types? If that is correct, you can use the below script in the report. At the same time, the Member types parameter can be removed as it is not used. It is recommended to create a copy of the built-in report and modify it rather than the report itself.

# Set search criteria
$criteria = New-AdmCriteria "user" -Expression {accountDisabled -eq $False}
$Context.DirectorySearcher.AddCriteria($criteria)

# Build the report
$Context.Items.Add($Context.DirectorySearcher)
0

Hi, this is not what I want to do.

I need the report to only include members of the selected groups that are NOT DISABLED.

Is it possible?

0

Hello,

This exactly what the above solution does. The report will include all the enabled users who are members of the selected group. For your information, groups cannot be disabled. There is just no such functionality in AD.

0

Hi, I didn't catch the first answer. That's rigth. The proposed solution is just what I'm looking for.

Thank you very much

Related questions

0 votes
1 answer

If I have 2 Active Directory Security groups in my domain - Group A Group B Is it possible to create a report that shows only users who have membership in both groups? For ... Jane Doe is in Group A AND Group B she would be included in the resulting report.

asked May 11, 2020 by sirslimjim (480 points)
0 votes
1 answer

Hello, I have 3 groups in my AD environment and want to show all the users that belong to each group. For example - Group 1 Group 2 Group 3 The existing report in the Adaxes ... -Usser D etc. Is there a way to create a report like this? Thank you in advance!

asked Nov 6, 2020 by sirslimjim (480 points)
0 votes
1 answer

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 ... then run the report and it will show me all groups that start with XY. Thanks a lot

asked Oct 25, 2023 by DRiVSSi (280 points)
0 votes
1 answer

I'm trying to combine these two scripts to effectively store a user's group memberships in customattributebinary5 and then be able to copy and paste those memberships to a ... ) $Context.LogMessage("Added the user to group '$groupName'", "Information") }

asked Jan 24, 2020 by yourpp (540 points)
0 votes
1 answer

How can I create a script that does these things For internal audit. objective Even removing all groups of a disconnected user, we will still know which groups the ... in the created group (audit)-sAMAccountName-access add the (user)-sAMAccountName in members

asked Jul 2, 2022 by alancardoso (40 points)
3,439 questions
3,135 answers
7,993 comments
546,403 users