How to Force Azure AD Connect Sync with PowerShell | Step-by-Step Guide Start PowerShell using any of these methods (or any other you may know of):
- WinKey + R (Run Dialog): powershell.exe;
- Click Start Menu type Powershell, and run it;
- Right Mouse Button click on Start Menu and click on Windows PowerShell (Admin).
NOTE: If you’re running PowerShell on the server where Azure AD Connect is running, don’t run the command for remote server connection.
Run the command to connect to the remote server:
Enter-PSSession -ComputerName [SERVERNAME]
Import Azure AD Connect module.
Import-Module ADSync
Run the following command for synchronization.
For a Delta Sync:
Start-ADSyncSyncCycle -PolicyType Delta
For a Full Sync:
Start-ADSyncSyncCycle -PolicyType Initial
If you need Sync some changed attributes or a group membership – løbe Delta Sync.
Invoke-Command -ComputerName [ServerWithAzureADConnect] -ScriptBlock
{
Import-Module adsync
Start-ADSyncSyncCycle -PolicyType Delta
}