Hi Everyone.
Finally i come back to India and it is always love to be at home.
My today’s task was to create a list of all empty active directory groups, all groups those are not having any members.
As you know, i don’t like to do the manual tasks, so i decided to use powershell to accomplished this.
Lets do it.
Import Active Directory module.
Import-Module ActiveDirectory
Once, Active Directory Module is loaded, run the below command.
Get-ADGroup -Filter * -Properties Members | where { -not $_.Members} | select Name |
Now , this will give you the list of all empty groups.
Now we have two groups “*ASKLAILA” and “*Hello Sir” as a result of the above command.
Now lets cross-verified our result.
I hope you find this useful.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.