Solved

ADSI: EmptySecurityGroups_DistributionGroup::

Posted on 2012-03-30
4
182 Views
Last Modified: 2013-02-26
Hi Team,
Is there a way to list all empty ADSI LDAP security groups and/or distribution groups in an active directory?

thx

JohnE
0
Comment
Question by:John Esraelo
  • 3
4 Comments
 

Author Comment

by:John Esraelo
ID: 37789481
This is, for instance, a nice one to get the admins in the domain.
I wonder if there is a simple way of getting a list of "empty" security groups and distribution groups.  (got this from a site a few minutes ago)

$Recurse = $true

Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$ct = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$group=[System.DirectoryServices.AccountManagement.GroupPrincipal]::FindByIdentity($ct,'Administrators')
$group.GetMembers($Recurse)

Open in new window

0
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 37794053
I wrote a quick app in .NET once that will list all the groups with duplicate members in it - you could use that to identify all the groups that had no members (pick an empty group you know of and have it find all the matching groups). If nobody else posts a better solution, I could find a copy of the tool and upload it.

I'm not sure how you'd do it with powershell though.
0
 

Accepted Solution

by:
John Esraelo earned 0 total points
ID: 37797924
I have actually go an answer without using .Net and strictly using PowerShell .

Thank though.

JohnE
0
 

Author Closing Comment

by:John Esraelo
ID: 38929197
I have found the answer without using the .Net therefore.  Practically did not get an answer that I was looking for.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question