Forum Discussion

Aubrey Moren's avatar
Aubrey Moren
Copper Contributor
Aug 15, 2019

Exchange Online Missing Get-DynamicDistributionGroup

I have a service account that I use for scripting some things in Exchange, but for some reason that I can't figure out, it doesn't get Get-DynamicDistributionGroup: PS C:\Scripts> get-command -Modul...
  • VasilMichev's avatar
    Aug 15, 2019

    If you only get the Set- cmdlet, you most likely dont have the relevant role assigned ("Distribution Groups"), as the role should also contain the New-/Remove- cmdlets, in addition to the Get- one.

     

    In particular the Set-DynamicDistributionGroup can also be granted as part of the MyDistributionGroups role, part of the default role assignment policy. And the role in question does not contain any of the other DDG cmdlets:

     

    # Get-ManagementRoleEntry "MyDistributionGroups\*-DynamicDistributionGroup"
    Name                           Role                      Parameters
    ----                           ----                      ----------
    Set-DynamicDistributionGroup   MyDistributionGroups      {ErrorAction, ErrorVariable, Identity, MailTip, MailTipTranslations, OutBuffer, OutVariable}

     

    which looks exactly what you are getting.

Resources