Apr 12 2017
10:09 AM
- last edited on
Jan 14 2022
05:33 PM
by
TechCommunityAP
Apr 12 2017
10:09 AM
- last edited on
Jan 14 2022
05:33 PM
by
TechCommunityAP
Just getting into Azure and imported a bunch of empty Security Groups into Azure AD. Trying to sort out a way to delete Groups if they have 0 members. Anyone got a quick way to do that?
Thank you.
Chris
Apr 12 2017 11:00 AM
Try something like this:
Get-MsolGroup -GroupType Security | ? {(Get-MsolGroupMember -GroupObjectId $_.ObjectId).count -eq 0 }
Apr 12 2017 11:05 AM