In some situations we have to Export all the Distribution group and all the members of it to a CSV file. There is no command let available to retrieve the distribution group and distribution group members in bulk. Pipe line won’t work in this case.
NEW
**** Export all the Distribution group and Distribution Group managers as well***
***Export all the Dynamic Distribution group and Dynamic Distribution Group managers as well***
DisplayName
Alias
RecipientType
Recipient OU
Primary SMTP address
Distribution Group
Distribution Group Primary SMTP address
Distribution Group Managers
Distribution Group OU
I have wrote a script which will make Exchange Administrators life Easy to export distribution group and its members.
.Requires -version 2 – Runs in Exchange Management Shell
.\DistributionGroupMemberReport.ps1 – It Can Display all the Distribution Group and its members on a List
Or It can Export to a CSV file
Browse the Shell to the Appropriate Location
Run it as above
Output of CSV file look like Below
You can add some more entries if required
How to use this Script for Office 365 –
Local desktop . PowerShell – Run as Administrator
Make Sure your Execution Policy is set to RemoteSigned or Unrestricted
Set-ExecutionPolicy RemoteSigned
my Case its unrestricted.
To Get Execution Policy Status
Get-ExecutionPolicy
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Now Run the Script – It should work.
The post How to Export all distribution Group and All members of it (Exchange 2007 & Exchange 2010 & Exchange 2013) appeared first on CareExchange.in.