az ad group owner

Roger Roger 7,181 Reputation points
2021-10-11T19:28:13.577+00:00

Hi

I have an office 365 unified group lets say test1@Company portal .com. i have added owner to it in exchange online admin center, i also want to add the owner in Azure AD for this unified group.

i have referred the below article but not sure of the syntax.
https://learn.microsoft.com/en-us/cli/azure/ad/group/owner?view=azure-cli-latest#az_ad_group_owner_add

az ad group owner add --group test1@Company portal .com --owner-object-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

I want to make user1@Company portal .com as owner for this group in Azure AD. how do i get the object id for the user. please guide me.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,195 questions
Exchange | Exchange Server | Management
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Joyce Shen - MSFT 16,701 Reputation points
    2021-10-12T02:05:16.097+00:00

    Hi @Roger Roger

    We could use the method below to find the object id of the user

    1. Sign in to the Office 365 Admin Portal with an account in the desired tenant with the appropriate administrative rights.
    2. In the left-side menu, expand the Admin Centers section at the bottom and then select the Azure Active Directory option to launch the admin console in a new browser window.
    3. Select Users.
    4. Browse to or search for the desired user, then select the account name to view the user account's profile information.
    5. The Object ID is located in the Identity section on the right.
      139639-image.png

    Or you could use the Get-AzureADUser command to meet this need as well. -ObjectId Specifies the ID (as a UPN or ObjectId) of a user in Azure AD.

    Get-AzureADUser -objectID "******@contoso.com"  
    OR  
    Get-AzureADUser -Filter "userPrincipalName eq '******@contoso.com'"  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.

    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.


2 additional answers

Sort by: Most helpful
  1. Andreas Baumgarten 123.9K Reputation points MVP Volunteer Moderator
    2021-10-12T04:38:08.27+00:00

    Hi @Roger Roger ,

    please verify if the folder with AZ CLI files is added to the PATH ( C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin )

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten


  2. Roger Roger 7,181 Reputation points
    2021-10-13T17:33:41.307+00:00

    Below syntax worked for me

    az ad group owner add --group 76hu890-68ui-4820-8450-12e6e2beii9c --owner-object-id 76uji987-6d8a-1235-8eca-d8d2f106d7dd

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.