Disconnect Objects with AAD Connect by PowerShell

 This a quick memo on how to disconnect objects from AADConnect with PowerShell.  There is a blog to describe the process.  But as the csdelete.exe has been replaced by the PowerShell command Remove-ADSyncCSObject. So I just record the process to use the PowerShell to do this.


$userCN = "CN=Test User,DC=Maincotech,DC=com" #Specify the user's distinguishedName
$connectorName = "Maincotech.com" #Specify the connector name for On-primse AD
$csObj = Get-ADSyncCSObject -DistinguishedName $userCN -ConnectorName $connectorName
Remove-ADSyncCSObject -CsObject $csObj -Force


Run delta sync with the PowerShell command below.

Start-ADSyncSyncCycle -PolicyType Delta


That's all.


Comments

Popular posts from this blog

Use Power Automate to archive the SendGrid activity events

Use LESS in Blazor Application