You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/hybrid/how-to-connect-sync-staging-server.md
+75-31Lines changed: 75 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,11 @@ ms.author: billmath
18
18
ms.collection: M365-identity-device-management
19
19
---
20
20
# Azure AD Connect: Staging server and disaster recovery
21
+
21
22
With a server in staging mode, you can make changes to the configuration and preview the changes before you make the server active. It also allows you to run full import and full synchronization to verify that all changes are expected before you make these changes into your production environment.
22
23
23
24
## Staging mode
25
+
24
26
Staging mode can be used for several scenarios, including:
25
27
26
28
* High availability.
@@ -41,6 +43,7 @@ A server in staging mode continues to receive changes from Active Directory and
41
43
For those of you with knowledge of older sync technologies, the staging mode is different since the server has its own SQL database. This architecture allows the staging mode server to be located in a different datacenter.
42
44
43
45
### Verify the configuration of a server
46
+
44
47
To apply this method, follow these steps:
45
48
46
49
1.[Prepare](#prepare)
@@ -50,14 +53,17 @@ To apply this method, follow these steps:
50
53
5.[Switch active server](#switch-active-server)
51
54
52
55
#### Prepare
56
+
53
57
1. Install Azure AD Connect, select **staging mode**, and unselect **start synchronization** on the last page in the installation wizard. This mode allows you to run the sync engine manually.
54
58

55
59
2. Sign off/sign in and from the start menu select **Synchronization Service**.
56
60
57
61
#### Configuration
62
+
58
63
If you have made custom changes to the primary server and want to compare the configuration with the staging server, then use [Azure AD Connect configuration documenter](https://github.com/Microsoft/AADConnectConfigDocumenter).
59
64
60
65
#### Import and Synchronize
66
+
61
67
1. Select **Connectors**, and select the first Connector with the type **Active Directory Domain Services**. Click **Run**, select **Full import**, and **OK**. Do these steps for all Connectors of this type.
62
68
2. Select the Connector with type **Azure Active Directory (Microsoft)**. Click **Run**, select **Full import**, and **OK**.
63
69
3. Make sure the tab Connectors is still selected. For each Connector with type **Active Directory Domain Services**, click **Run**, select **Delta Synchronization**, and **OK**.
@@ -66,6 +72,7 @@ If you have made custom changes to the primary server and want to compare the co
66
72
You have now staged export changes to Azure AD and on-premises AD (if you are using Exchange hybrid deployment). The next steps allow you to inspect what is about to change before you actually start the export to the directories.
67
73
68
74
#### Verify
75
+
69
76
1. Start a cmd prompt and go to `%ProgramFiles%\Microsoft Azure AD Sync\bin`
70
77
2. Run: `csexport "Name of Connector" %temp%\export.xml /f:x`
71
78
The name of the Connector can be found in Synchronization Service. It has a name similar to "contoso.com – Azure AD" for Azure AD.
@@ -74,22 +81,26 @@ You have a file in %temp% named export.csv that can be examined in Microsoft Exc
74
81
4. Make necessary changes to the data or configuration and run these steps again (Import and Synchronize and Verify) until the changes that are about to be exported are expected.
75
82
76
83
**Understanding the export.csv file**
84
+
77
85
Most of the file is self-explanatory. Some abbreviations to understand the content:
78
86
* OMODT – Object Modification Type. Indicates if the operation at an object level is an Add, Update, or Delete.
79
87
* AMODT – Attribute Modification Type. Indicates if the operation at an attribute level is an Add, Update, or delete.
80
88
81
89
**Retrieve common identifiers**
90
+
82
91
The export.csv file contains all changes that are about to be exported. Each row corresponds to a change for an object in the connector space and the object is identified by the DN attribute. The DN attribute is a unique identifier assigned to an object in the connector space. When you have many rows/changes in the export.csv to analyze, it may be difficult for you to figure out which objects the changes are for based on the DN attribute alone. To simplify the process of analyzing the changes, use the `csanalyzer.ps1` PowerShell script. The script retrieves common identifiers (for example, displayName, userPrincipalName) of the objects. To use the script:
83
92
1. Copy the PowerShell script from the section [CSAnalyzer](#appendix-csanalyzer) to a file named `csanalyzer.ps1`.
84
93
2. Open a PowerShell window and browse to the folder where you created the PowerShell script.
4. You now have a file named **processedusers1.csv** that can be examined in Microsoft Excel. Note that the file provides a mapping from the DN attribute to common identifiers (for example, displayName and userPrincipalName). It currently does not include the actual attribute changes that are about to be exported.
87
96
88
97
#### Switch active server
98
+
89
99
Azure AD Connect can be set up in an Active-Passive High Availability setup, where one server will actively push changes to the synced AD objects to Azure AD and the passive server will stage these changes in the event it will need to take over.
90
100
91
-
Note: You cannot set up Azure AD Connect in an Active-Active setup. It must be Active-Passive
92
-
Ensure that only 1 Azure AD Connect server is actively syncing changes.
101
+
>[!Note]
102
+
>
103
+
>You cannot set up Azure AD Connect in an Active-Active setup. It must be Active-Passive. Ensure that only 1 Azure AD Connect server is actively syncing changes.
93
104
94
105
For more information on setting up an Azure AD Connect sync server in Staging Mode, see [staging mode](how-to-connect-sync-staging-server.md)
95
106
@@ -100,58 +111,85 @@ You may need to perform a failover of the Sync Servers for several reasons, such
100
111
- One currently active Azure AD Connect Sync Server
101
112
- One staging Azure AD Connect Sync Server
102
113
103
-
#### Changing Currently Active Sync Server to Staging Mode
114
+
#### Change currently Active Sync Server to staging mode
104
115
105
116
We need to ensure that only one Sync Server is syncing changes at any given time throughout this process. If the currently Active Sync Server is reachable you can perform the below steps to move it to Staging Mode. If it is not reachable, ensure that the server or VM does not regain access unexpectedly either by shutting down the server or isolating it from outbound connections and proceed to the steps on how to change the currently Staging Sync Server to Active Mode.
106
117
107
-
1. For the currently Active Azure AD Connect server, open the Azure AD Connect Console and click "Configure staging mode" then Next:
108
-
[Insert Image: "active_server_menu.png"]
118
+
1. For the currently Active Azure AD Connect server, open the Azure AD Connect Console and click "Configure staging mode" then Next:
119
+
120
+
> [!div class="mx-imgBorder"]
121
+
> 
122
+
123
+
2. You will need to sign into Azure AD with Global Admin or Hybrid Identity Admin credentials:
109
124
110
-
2. You will need to sign into Azure AD with Global Admin or Hybrid Identity Admin credentials:
111
-
[Insert Image: "active_server_sign_in.png"]
125
+
> [!div class="mx-imgBorder"]
126
+
> 
112
127
113
-
3. Tick the box for Staging Mode and click Next:
114
-
[Insert Image: "active_server_staging_mode.png"]
128
+
3. Tick the box for Staging Mode and click Next:
115
129
116
-
4. The Azure AD Connect server will check for installed components and then prompt you whether you want to start the sync process:
117
-
[Insert Image: "active_server_config.png"]
118
-
Since the server will be in staging mode, it will not write changes to Azure AD, but retain any changes to the AD in its Connector Space, ready to write them.
130
+
> [!div class="mx-imgBorder"]
131
+
> 
132
+
133
+
4. The Azure AD Connect server will check for installed components and then prompt you whether you want to start the sync process:
134
+
135
+
> [!div class="mx-imgBorder"]
136
+
> 
137
+
138
+
Since the server will be in staging mode, it will not write changes to Azure AD, but retain any changes to the AD in its Connector Space, ready to write them.
119
139
It is recommended to leave the sync process on for the server in Staging Mode, so if it becomes active, it will quickly take over and won't have to do a large sync to catch up to the current state of the AD/Azure AD sync.
120
140
121
-
5. After selecting whether to start or stop the sync process and clicking Configure, the Azure AD Connect server will configure itself into Staging Mode.
122
-
When this is completed, you will be prompted with a screen that confirms Staging Mode is enabled.
141
+
5. After selecting whether to start or stop the sync process and clicking Configure, the Azure AD Connect server will configure itself into Staging Mode.
142
+
When this is completed, you will be prompted with a screen that confirms Staging Mode is enabled.
123
143
You can click Exit to finish this.
124
144
125
-
6. You can confirm that the server is successfully in Staging Mode by opening the Synchronization Service console.
126
-
From here, there should be no more Export jobs since the change and Full & Delta Imports will be suffixed with "(Stage Only)" like below:
6. You can confirm that the server is successfully in Staging Mode by opening the Synchronization Service console.
146
+
From here, there should be no more Export jobs since the change and Full & Delta Imports will be suffixed with "(Stage Only)" like below:
147
+
148
+
> [!div class="mx-imgBorder"]
149
+
> 
128
150
129
-
#### Changing Currently Staging Sync Server to Active Mode
151
+
#### Change current Staging Sync server to active mode
130
152
131
153
At this point, all of our Azure AD Connect Sync Servers should be in Staging Mode and not exporting changes.
132
154
We can now move our Staging Sync Server to Active mode and actively sync changes.
133
155
134
-
1. Now move to the Azure AD Connect server that was originally in Staging Mode and open the Azure AD Connect console.
135
-
Click on "Configure staging mode" and click Next:
136
-
[Insert Image: "staging_server_menu.png"]
137
-
Note the message at the bottom of the Console that indicates this server is in Staging Mode.
156
+
1. Now move to the Azure AD Connect server that was originally in Staging Mode and open the Azure AD Connect console.
157
+
158
+
Click on "Configure staging mode" and click Next:
159
+
160
+
> [!div class="mx-imgBorder"]
161
+
> 
162
+
163
+
The message at the bottom of the Console indicates this server is in Staging Mode.
138
164
139
165
2. Sign into Azure AD, then go to the Staging Mode screen.
140
-
Untick the box for Staging Mode and click Next
141
-
[Insert Image: "staging_server_staging_mode.png"]
142
-
As per the warning on this page, it is important to ensure no other Azure AD Connect server is actively syncing.
143
-
There should only be one active Azure AD Connect sync server at any time.
144
166
145
-
3. When you are prompted to start the sync process, tick this box and click Configure:
146
-
[Insert Image: "staging_server_config.png"]
167
+
Untick the box for Staging Mode and click Next
168
+
169
+
> [!div class="mx-imgBorder"]
170
+
> 
171
+
172
+
As per the warning on this page, it is important to ensure no other Azure AD Connect server is actively syncing.
173
+
174
+
There should only be one active Azure AD Connect sync server at any time.
175
+
176
+
3. When you are prompted to start the sync process, tick this box and click Configure:
177
+
178
+
> [!div class="mx-imgBorder"]
179
+
> 
147
180
148
-
4. Once the process is finished you should get the below confirmation screen where you can click Exit to finish:
149
-
[Insert Image: "staging_server_confirmation.png"]
181
+
4. Once the process is finished you should get the below confirmation screen where you can click Exit to finish:
182
+
183
+
> [!div class="mx-imgBorder"]
184
+
> 
150
185
151
186
5. You can again confirm that this is working by opening the Sync Service Console and checking if Export jobs are running:
> 
153
190
154
191
## Disaster recovery
192
+
155
193
Part of the implementation design is to plan for what to do in case there is a disaster where you lose the sync server. There are different models to use and which one to use depends on several factors including:
156
194
157
195
* What is your tolerance for not being able make changes to objects in Azure AD during the downtime?
@@ -167,24 +205,29 @@ Depending on the answers to these questions and your organization’s policy, on
167
205
If you do not use the built-in SQL Express database, then you should also review the [SQL High Availability](#sql-high-availability) section.
168
206
169
207
### Rebuild when needed
208
+
170
209
A viable strategy is to plan for a server rebuild when needed. Usually, installing the sync engine and do the initial import and sync can be completed within a few hours. If there isn’t a spare server available, it is possible to temporarily use a domain controller to host the sync engine.
171
210
172
211
The sync engine server does not store any state about the objects so the database can be rebuilt from the data in Active Directory and Azure AD. The **sourceAnchor** attribute is used to join the objects from on-premises and the cloud. If you rebuild the server with existing objects on-premises and the cloud, then the sync engine matches those objects together again on reinstallation. The things you need to document and save are the configuration changes made to the server, such as filtering and synchronization rules. These custom configurations must be reapplied before you start synchronizing.
173
212
174
213
### Have a spare standby server - staging mode
214
+
175
215
If you have a more complex environment, then having one or more standby servers is recommended. During installation, you can enable a server to be in **staging mode**.
176
216
177
217
For more information, see [staging mode](#staging-mode).
178
218
179
219
### Use virtual machines
220
+
180
221
A common and supported method is to run the sync engine in a virtual machine. In case the host has an issue, the image with the sync engine server can be migrated to another server.
181
222
182
223
### SQL High Availability
224
+
183
225
If you are not using the SQL Server Express that comes with Azure AD Connect, then high availability for SQL Server should also be considered. The high availability solutions supported include SQL clustering and AOA (Always On Availability Groups). Unsupported solutions include mirroring.
184
226
185
227
Support for SQL AOA was added to Azure AD Connect in version 1.1.524.0. You must enable SQL AOA before installing Azure AD Connect. During installation, Azure AD Connect detects whether the SQL instance provided is enabled for SQL AOA or not. If SQL AOA is enabled, Azure AD Connect further figures out if SQL AOA is configured to use synchronous replication or asynchronous replication. When setting up the Availability Group Listener, it is recommended that you set the RegisterAllProvidersIP property to 0. This is because Azure AD Connect currently uses SQL Native Client to connect to SQL and SQL Native Client does not support the use of MultiSubNetFailover property.
186
228
187
229
## Appendix CSAnalyzer
230
+
188
231
See the section [verify](#verify) on how to use this script.
189
232
190
233
```powershell
@@ -334,6 +377,7 @@ else
334
377
```
335
378
336
379
## Next steps
380
+
337
381
**Overview topics**
338
382
339
383
*[Azure AD Connect sync: Understand and customize synchronization](how-to-connect-sync-whatis.md)
0 commit comments