Stack Overflow Asked by Manuel K on September 21, 2020
I want to uniquely identify a group that is used in Exchange Online so that I can find the same group in Azure AD. The group has, in my case, permissions on a mailbox as returned by Get-MailboxPermission
in PowerShell.
When using the Get-Group
cmdlet from the ExchangePowerShell-Module I get a few identifying properties, but none of those are helpful in identifying the same group in Azure AD:
In Azure AD I have a whole other set of identifying properties (e.g. Graph API):
It seems my only option would be to use a combination of DisplayName and maybe WindowsEmailAddress/Mail which is horrible?
Is there any other way I could uniquely identify the groups to match them together?
UPDATE:
My scenario is as follows:
I need to process all permissions of all mailboxes:
Get-MailboxPermission
for every mailbox.Get-User
or Get-Mailbox
cmdlets.ExternalDirectoryObjectId
as returned by Get-User
.ExternalDirectoryObjectId
and no other uniquely identifying and unchangable property that can be found in Azure AD.Case 1 : Matching the Group ID From Graph API to Exchange Online Commandlets
Getting the list of the groups from the Graph and matching it with the group from the Exchange Online Commandlets.
The Id Obtained from the Graph API will match that of the Get-Group
The below is the snippet of the Graph response :
{
"id": "c0749057-8163-4228-be88-1a0df3aab7b1",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2020-09-08T11:21:53Z",
"creationOptions": [],
"description": "This is a new Group",
"displayName": "NewGroup1",
"expirationDateTime": null..............
If you get the Id : c0749057-8163-4228-be88-1a0df3aab7b1 & Run the below command, you will get the corresponding group :
Get-Group -Identity "c0749057-8163-4228-be88-1a0df3aab7b1"
Output :
Case 2 : Matching the Group ID from the Exchange Online Commandlets to Graph Group ID
(UPDATE)
Only the unified groups will be visible in the Graph APIs (or) will have the ExternalDirectoryObjectId
So you could run
(Get-UnifiedGroup -Identity <Your Exchange Group ID>).ExternalDirectoryObjectId
This will return the Azure AD Object Id of the Group.
HTH !
Correct answer by sathya_vijayakumar-MSFT on September 21, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP