In this article, we explore how to change the email address that receives the Office 365 directory synchronization failure notifications. We will explore how to do this with PowerShell.
Let’s get started!
Getting connected
First, you will need to have access to the Windows Azure Active Directory Module for Windows PowerShell. An article detailing how to install this module and all prerequisites can be found here.
You should have an icon on your desktop named Windows Azure Active Directory Module for Windows PowerShell. Right-click on this icon and select Run As Administrator from the context menu.
At the PowerShell prompt enter the following command and hit enter.
C:\> Set-ExecutionPolicy –ExecutionPolicy RemoteSigned Execution Policy Change The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):
Press Y for yes and hit Enter.
First, we will need to capture our credentials in a variable. We will call our variable $password. Issue the following command and hit enter.
C:\> $password=Get-Credential
A dialog box will appear asking for your credentials. Enter your Office 365 global administrator email address and password. Click Ok. You will be returned to a PowerShell prompt.
Next, we will connect to Azure Active Directory with the Connect-MSOLService command. We will also parse in our password variable.
C:\> Connect-MsolService –Credential $password
Changing the directory synchronization notification address
To determine which email address is currently receiving failure notifications type the following command.
C:\> Get-MsolCompanyInformation | FL DisplayName, TechnicalNotificationEmails DisplayName : SuperTekBoy LLC TechnicalNotificationEmails : {alerts@supertekboy.com}
In the above example, we can see our failure notifications are going to alerts@supertekboy.com. If we wanted to change this address we would issue the Set-MsolCompanyContactInformation command. In the example below, we are changing the notification email to go to info@supertekboy.com.
C:\> Set-MsolCompanyContactInformation -TechnicalNotificationEmails "info@supertekboy.com"
To confirm this change reissue the Get-MsolCompanyInformation command.
Tip: There is a benefit to switching this address to that of a distribution group. Not only does it allow for messages to be sent to multiple individuals but changing group membership is an easier way to govern who receives the alerts.
SBD says
When can we receive alerts (within what time) post dirsync stops working. I want email notification asap on dirsync stops working.
Thanks & Regards
Gareth Gudger says
Hi SBD,
I am not aware of any possible customization to the notification schedule.
Raj says
My Manger is moving to a different project and he keep on asking me to remove him this alerts.. I was searching for this control.. and your article helped me 🙂