Sync passwords using PowerShell

Step 1: Install and Import the Azure AD Module

Before syncing passwords, install and import the required module.

Install-Module -Name AzureAD
Import-Module AzureAD
  • Install-Module (downloads the Azure AD module)
  • Import-Module (makes the commands available for use)

Step 2: Connect to Azure AD

Authenticate with Azure AD to manage synchronization settings.

Connect-AzureAD

Note: A prompt will appear to enter admin credentials.

Step 3: Enable Password Synchronization

Check if password sync is enabled. If not, enable it using the command below.

$tenantId = (Get-MsolCompanyInformation).ObjectId
Set-MsolDirSyncFeature -Feature PasswordSync -Enable $true
  • Get-MsolCompanyInformation (fetches the tenant ID)
  • Set-MsolDirSyncFeature (enables password sync for the tenant)

Step 4: Force a Manual Sync

Run the command below to sync passwords immediately instead of waiting for the scheduled sync.

Start-ADSyncSyncCycle -PolicyType Delta
  • Delta (syncs only changed passwords instead of a full sync)

FAQs

1. How can I manually sync AD passwords to Office 365?

Use the following command to force password synchronization:

Start-ADSyncSyncCycle -PolicyType Delta

This syncs only changes made since the last sync.

2. How do I check the sync status?

The sync status can be checked by running the command below. This will display the last sync time and next scheduled sync.

Get-ADSyncScheduler

3. How can I enable automatic password synchronization?

Ensure Azure AD Connect is installed and configured. Then, enable synchronization using the command below.

Set-ADSyncScheduler -SyncCycleEnabled $true
 
  • Step 1: Install and Import the Azure AD Module
  • Step 2: Connect to Azure AD
  • Step 3: Enable Password Synchronization
  • Step 4: Force a Manual Sync
  • FAQs

ADSelfService Plus trusted by

A single pane of glass for complete self service password management
Email Download Link