Azure AD - How can i add Change Notification Email through PowerShell?

Personal CAD SINGAMR3 N 1 Reputation point
2022-10-17T08:02:20.563+00:00

![250949-image.png]1

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,188 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Harpreet Singh Matharoo 8,366 Reputation points Microsoft Employee
    2022-10-17T08:58:41.387+00:00

    Hello @Personal CAD SINGAMR3 N

    You can either use Microsoft Graph PowerShell as detailed below to set "notificationEmailAddresses" for Enterprise application SAML Signing Certificate.

    Detailed steps:

    • Sign-in:
      Use the Connect-MgGraph command to sign in with the required scopes. Example: Connect-MgGraph -Scopes "Directory.AccessAsUser.All Directory.Read.All Directory.ReadWrite.All"
    • Call Microsoft Graph:
      Use the Get-MgServicePrincipal command to get a list of enterprise application's NotificationEmailAddresses, and then create a custom script using your own logic to change email addresses based on conditions in the loop section using 'if' or 'foreach' conditions.
    • Here are a few examples for your reference:

    List all Enterprise applications with NotificationEmailAddresses:
    Get-MgServicePrincipal -All |select Id, DisplayName, NotificationEmailAddresses

    To update NotificationEmailAddresses on a Single Enterprise Application:
    Update-MgServicePrincipal -ServicePrincipalId 25dbe63f-2356-4dca-9911-5eb3e8e966e9 -NotificationEmailAddresses ******@contoso.onmicrosoft.com

    To update new NotificationEmailAddresses on all Enterprise applications
    Get-MgServicePrincipal -all |% {Update-MgServicePrincipal -ServicePrincipalId $_.id -NotificationEmailAddresses ******@contoso.onmicrosoft.com}

    (Note: The cmdlet above replaces all current email addresses for all applications.)

    I hope this helps.

    ----------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

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.