Before syncing passwords, install and import the required module.
Install-Module -Name AzureAD
Import-Module AzureAD Authenticate with Azure AD to manage synchronization settings.
Connect-AzureAD Note: A prompt will appear to enter admin credentials.
Check if password sync is enabled. If not, enable it using the command below.
$tenantId = (Get-MsolCompanyInformation).ObjectId
Set-MsolDirSyncFeature -Feature PasswordSync -Enable $true Run the command below to sync passwords immediately instead of waiting for the scheduled sync.
Start-ADSyncSyncCycle -PolicyType DeltaUse the following command to force password synchronization:
Start-ADSyncSyncCycle -PolicyType DeltaThis syncs only changes made since the last sync.
The sync status can be checked by running the command below. This will display the last sync time and next scheduled sync.
Get-ADSyncScheduler Ensure Azure AD Connect is installed and configured. Then, enable synchronization using the command below.
Set-ADSyncScheduler -SyncCycleEnabled $true