# Sript powershell for empty groups and empty member of

**URL:** <https://forums.powershell.org/t/sript-powershell-for-empty-groups-and-empty-member-of/22124>\
**Category:** PowerShell Help\
**Created:** [April 12, 2023, 11:19pm UTC](https://forums.powershell.org/t/sript-powershell-for-empty-groups-and-empty-member-of/22124 "2023-04-12T23:19:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vibe](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@Vibe](https://forums.powershell.org/u/Vibe)\
**Post date:** [April 12, 2023, 11:19pm UTC](https://forums.powershell.org/t/sript-powershell-for-empty-groups-and-empty-member-of/22124/1 "2023-04-12T23:19:40Z")

</div>

Hey guys,

I need a powershell script to list all the empty groups with empty member of as well

Someone could help please?

---

<div class="post-metadata">

**Author:** ![Matt](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Matt](https://forums.powershell.org/u/Matt)\
**Post date:** [April 13, 2023, 3:17am UTC](https://forums.powershell.org/t/sript-powershell-for-empty-groups-and-empty-member-of/22124/2 "2023-04-13T03:17:08Z")

</div>

This is a highly common system administrative task, have you tried a Google search to see what others have shared in blogs and other forum posts?

Example of a search string for your preferred search provider.

```auto
powershell script to find empty groups

```

This will give you a whole lot of returns for ideas and examples.

---

<div class="post-metadata">

**Author:** ![Vunizea](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/vunizea/32/4482_2.png) [@Vunizea](https://forums.powershell.org/u/Vunizea)\
**Post date:** [April 13, 2023, 5:08am UTC](https://forums.powershell.org/t/sript-powershell-for-empty-groups-and-empty-member-of/22124/3 "2023-04-13T05:08:24Z")

</div>

> [@Vibe](#):
>
> I need a powershell script to list all the empty groups with empty member of as well

PowerShell script that can list all the empty groups with empty members:

```auto
Get-ADGroup -Filter {GroupCategory -eq "Security"} -Properties Members |
Where-Object {-not $_.Members} |
Select-Object Name

```

This script uses the `Get-ADGroup` cmdlet to retrieve all security groups in the Active Directory domain, and then filters them based on the `Members` property. The `Where-Object` cmdlet is used to select only those groups that have no members, and the `Select-Object` cmdlet is used to display only the group names.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/powershell/original/1X/385e4f9fe133561ad30a814262fe0e0ae6bc3ef0.png) [@system](https://forums.powershell.org/u/system)\
**Post date:** [February 10, 2024, 5:34pm UTC](https://forums.powershell.org/t/sript-powershell-for-empty-groups-and-empty-member-of/22124/4 "2024-02-10T17:34:04Z")

</div>

Closed on February 10, 2024, 5:34pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
