Exchange Powershell : Is it possible to differentiate on prem and cloud based distribution group?

FnxQT 21 Reputation points
2021-10-18T13:55:41.467+00:00

I'm trying to create a script that must count the number of cloud and on prem based distribution group in a hybrid Exchange setup (on-prem + office 365).

I already did that with the users mailbox, it's possible to differentiate them by using the RecipientTypeDetails attribute. A "UserMailBox" represents an on prem user and a "MailUser" represents a cloud user.

Is there something similar for distribution group ? I didn't find the answer.

I saw there were multiple attributes :

MailNonUniversalGroup
MailUniversalDistributionGroup
MailUniversalSecurityGroup

But I didn't find the differences between them.

Thank your for your help, regards

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,327 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,864 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,345 questions
0 comments No comments
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,206 Reputation points
    2021-10-19T07:12:35.863+00:00

    @FnxQT

    I think AndyDavid suggestion is correct:

    If you synced all Exchange on-premises groups to Exchange online(Based on your description, I think you have synced all group). You need to create group on Exchange on-premises first, then you will could sync it to Exchange online. So, the synced group is created on Exchange online.

    If you only sync a part of group to Exchange online, you will need to check from both Exchange on-premises and Exchange online:

    Exchange on-premises created group:

    Get-DistributionGroup -ResultSize unlimited | Measure-Object  
    

    Exchange online created group:

    Get-DistributionGroup -ResultSize unlimited | where {$_.IsDirSynced -eq $False} | Measure-Object  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Andy David - MVP 140.8K Reputation points MVP
    2021-10-18T15:13:09.317+00:00

    Look for atttibute:
    IsDirSynced

    If True then its synced from on-prem

    Assuming you are running this against Exchange Online Powershell:

    (Get-DistributionGroup -ResultSize unlimited |?{$_.IsDirSynced -eq $false}).count
    
    (Get-DistributionGroup -ResultSize unlimited |?{$_.IsDirSynced -eq $true}).count
    
    2 people found this answer helpful.

  2. Limitless Technology 39,331 Reputation points
    2021-10-20T09:36:08.05+00:00

    Hi there,

    In on-premise software, from implementation to the running of the solution, everything is done internally; whereby maintenance, safety, and updates also need to be taken care of in-house.
    With no third-party involvement, you assume complete ownership.

    Cloud computing is the delivery of on-demand computer system resources, requiring no active management, and usually includes applications such as storage and processing power.
    With a cloud-based subscription model, there is no need to purchase any additional infrastructure or licenses

    There are a few limits which apply to Office 365 distribution groups that you should be aware of:

    Member count for a distribution list: 100,000 (50,000 for organizations using AAD Connect, 15,000 if there is a slightly outdated DirSync in place).
    The number of groups created by a single user/admin: 300,000.


    --If the reply is helpful, please Upvote and Accept it as an answer--

    0 comments No comments