Solved

Get-DistributionGroup all groups without members

Posted on 2013-06-25
2
1,151 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create a Distribution Group in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >>…
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…

776 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