In Office 365 Exchange how does one obtain a list of existing dynamic distribution groups? Is power shell required?
2 Answers
You can see your groups via web UI: Exchange admin center -> recipients -> groups Then you need to search -> advanced search provide recipient types "Dynamic distribution groups" and OK it
Powershell is not required, but is a good option: You need to connect to Exchange Online session as per Microsoft Technet article.
Supply your Office365 admin user credentials:
$UserCredential = Get-Credential
Then create a session(one line):
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
And finally Import-PSSession $Session
When connected issue Get-DynamicDistributionGroup
which will give you the list.
-
Using powershell, I'm able to get a list using
Get-DistributionGroup
but not usingGet-DynamicDistributionGroup
, as that command does not exist when I try to use it.– leeand00Jul 15, 2016 at 13:01 -
1Make sure there is no error when you connect to office 365 session. I think you might miss some cmdlets if you have PowerShell execution policy set too restricted. Jul 15, 2016 at 13:05
-
I ran
Set-ExecutionPolicy -ExecutionPolicy ByPass
and then tried your powershell suggestion again, but I still don't end up with theGet-DynamicDistributionGroup
I do however have aSet-DynamicDistributionGroup
, I don't really want to use it though. I also received something about setting anAllowClobber
parameter when importing them, and then a bunch of commands that I assume are local and that importing them would use a proxy to call it remotely instead of the local ones.– leeand00Jul 15, 2016 at 15:16 -
Is it possible that the
Get-DynamicDistributionGroup
has been deprecated byGet-DistributionGroup
?– leeand00Jul 15, 2016 at 15:20 -
1Okay, it seems you already have Exchange powershell module on the machine where you run this session. AllowClobber would allow to merge modules, if I'm not mistaken. I would suggest you follow the article's section "What do you need to know before you begin?" to avoid any confusion. Dynamic Distribution Groups wouldn't deprecate regular DGs. Jul 15, 2016 at 15:22
You can use Exchange admin center to view all available dynamic distribution group. else you can use below PowerShell commands.
$Credential=Get-Credential -Credential $null
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credential -Authentication Basic -AllowRedirection
Import-PSSession $Session -AllowClobber
Get-DynamicDistributionGroup
viewing members of a Dynamic Distribution Group are not feasible in the Office 365 Admin Portal.PowerShell is the only way to view members.
https://gallery.technet.microsoft.com/Export-Office-365-Dynamic-7f66e229