Trying to figure out why a PowerShell domain controller replication job for a user object does not sync groupmemberships (memberOf).
$users = 'wtst, tst'
$usersArray = $users.Split(',')
Invoke-Command -ScriptBlock {`
$using:usersArray | ForEach-Object {`
(Write-Output "Processing user $($_)..."), `
((Sync-ADObject -Object "CN=$_,OU=XXXX,DC=XXXX,DC=XXXX" -Source 'XXXX' -Destination 'XXXX'))
}
} -ComputerName 'XXXX' -Credential $(Get-Credential)
Other profile properties sync just fine. What am I doing wrong?