Ensure the Active Directory module is installed and loaded by running the script below. This allows PowerShell to interact with AD.
Import-Module ActiveDirectoryFor password synchronization to work, ensure both domains trust each other. This establishes a trust relationship between domainA.com and another domain.
New-ADObject -Name "Trust" -Type container -Path "CN=System,DC=domainA,DC=com"Allow password changes to replicate between domains. This enables password replication between domainA.com and domainB.com.
Set-ADReplicationAttribute -Source "domainA.com" -Target "domainB.com" -Attribute "unicodePwd"Trigger an immediate password sync using the script below. This syncs only changed passwords instead of a full sync.
Start-ADSyncSyncCycle -PolicyType DeltaManually manually trigger password synchronization using the script below. This forces synchronization of changed passwords between domains.
Start-ADSyncSyncCycle -PolicyType DeltaCheck if password sync is enabled by running the script below. If an AD connector exists, sync is enabled.
Get-ADSyncConnector | Select-Object Name, TypeYes, but Azure AD Connect must be set up for cross-forest sync.