msgraph-sdk-powershell
msgraph-sdk-powershell copied to clipboard
Get-MgUser, Get-MgGroup, and extension attributes
Why does Get-MgGroup not support the set of 15 custom attributes available for Microsoft 365 groups in the same way that Get-MgUser does?
I suspect that the answer is that the group object doesn't support the custom attributes because they're an Exchange extension. However, many tenants use the custom attributes to store details about groups. They can manage the attributes with the Get/Set-UnifiedGroup cmdlets but not the SDK cmdlets.
In this case, I think the simple fact is that mailboxes are tightly associated with user accounts, and that's why the 15 Exchange custom attributes synchronize to Active Directory and Entra ID. The groups object has different types and some (like security groups) don't have an existence as a mail-enabled object so they're not in EXODS. The conclusion is that Entra ID therefore sees no need to synchronize properties that are not available for all group types, which means that if you want to access a custom attribute for a Microsoft 365 group, you need to run Get-UnifiedGroup.