Solved

Get-DistributionGroup all groups without members

Posted on 2013-06-25
2
1,301 Views
Last Modified: 2013-06-25
Whats the cmdlet to search then export to csv for all Distribution Lists that don't have any members in it?

Get-DistributionGroup .....................................................................

Thanks in advance.
0
Comment
Question by:GCTTechs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Assisted Solution

by:R--R
R--R earned 250 total points
ID: 39275174
0
 
LVL 22

Accepted Solution

by:
Haresh Nikumbh earned 250 total points
ID: 39275382
It finds all empty groups and exports the Group Name, Group Type, and location in the directory for you all in a CSV file.

Save to .ps1 and run with .\filename.ps1.

$groups = Get-DistributionGroup
$amount = @()
foreach ($a in $groups)
{
   $groupMem = Get-DistributionGroupMember $a
   if ($groupMem.Count -eq $null) { $amount += $a }
}
Write-Output $amount | Select-Object Name,GroupType,OrganizationalUnit | Export-CSV -notypeinformation -Path C:\Empty.csv


Source:

http://forums.msexchange.org/m_1800490641/tm.htm
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video discusses moving either the default database or any database to a new volume.

751 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