Powershell AD-Sync

For my future reference – force AD sync to o365

 

1 #  start-adsyncsynccycle -policytype delta

  

2 #   start-adsyncsynccycle -policytype Initial

 

3  #

$adConnector  = “exampledomin.com”

$aadConnector = “exampledomain.onmicrosoft.com – AAD”

Import-Module adsync

$c = Get-ADSyncConnector -Name $adConnector

$p = New-Object Microsoft.IdentityManagement.PowerShell.ObjectModel.ConfigurationParameter “Microsoft.Synchronize.ForceFullPasswordSync”, String, ConnectorGlobal, $null, $null, $null

$p.Value = 1

$c.GlobalParameters.Remove($p.Name)

$c.GlobalParameters.Add($p)

 

$c = Add-ADSyncConnector -Connector $c

 

Set-ADSyncAADPasswordSyncConfiguration -SourceConnector $adConnector -TargetConnector $aadConnector -Enable $false

 

Set-ADSyncAADPasswordSyncConfiguration -SourceConnector $adConnector -TargetConnector $aadConnector -Enable $true

 

Leave a Reply

Your email address will not be published. Required fields are marked *

sixteen + three =