Here’s a quick tip on howto enable or disable the Staging Mode in Azure AD Connect via PowerShell. Sadly there is no native Cmdlet in the style of Set-ADSyncStagingMode
or something like that.
In this article I’ll first explain the approach and then later on list the full command block you can use. So feel free to skip below to the end of the post. The following PowerShell Cmdlets have to get executed on the Azure AD Connect Server.
Execute these commands on your own risk.
List current Azure AD Connect Staging mode setting
First of all we can retrieve the current Azure AD Connect Settings using Get-ADSyncGlobalSettings
.
|
|
Investigate the Parameters of the ADSyncGlobalSettings Object
So the interesting stuff is hidden in the “parameters”-property. The settings regarding the Staging Mode lays in “Microsoft.Synchronize.StagingMode”.
|
|
Change the Staging Mode
To configure the Staging Mode we need to set “Microsoft.Synchronize.StagingMode” to either “True” (enable Staging mode) or “False” (disable Staging mode).
|
|
|
|
Actually SET the Staging Mode
Haha, yes. We’re not done yet. As of right now, we only have a PowerShell Object (“Microsoft.IdentityManagement.PowerShell.ObjectModel.GlobalSettings”) representing the Azure AD Connect settings. And changing that Object doesn’t change the actual configuration of Azure AD Connect. So we have to set the actual configuration to our modified Settings Object.
|
|
Afterwards I verified in the GUI (Azure AD Connect Wizard) for the desired result. In my case the Staging Mode was enabled now. Awesome!
Summary - Full Code Snippets
After we gathered all these informations, we can create our own short PowerShell Code Snippets to check/enable/disable the Azure AD Connect Staging mode.
Snippet to check for Azure AD Connect Staging Mode
|
|
Snippet to Disable Azure AD Connect Staging Mode
|
|
Snippet to Enable Azure AD Connect Staging Mode
|
|