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?
asked Sep 11, 2023 at 8:37
colonel_claypoo
6353 gold badges15 silver badges31 bronze badges
lang-bash
repadmin /syncalltho hopefully this is a test domain. Replication is not something you should be forcing in a production environment. I'm not certain thatSync-ADObjectforces replication of the object's attributes, only forces the replication of the object itself. In any case, ignore the comments from the above user, they're either trolling or have no idea what they talk about or both.