You will add or move OUs over time. Check three things each time you do, or a policy or a sync scope quietly stops matching.
Moving or renaming an OU
Protected OUs refuse to move. Lift the protection, move it, then protect it again.
$top = "OU=Contoso School,DC=ad,DC=contoso,DC=com" $ou = "OU=CON-Admins,OU=CON-Users,$top" # where it is now Set-ADObject -Identity $ou -ProtectedFromAccidentalDeletion $false Move-ADObject -Identity $ou -TargetPath $top Set-ADObject -Identity "OU=CON-Admins,$top" -ProtectedFromAccidentalDeletion $true
This is the fix if you built CON-Admins inside CON-Users by mistake. Fix it before you switch sync to a new tenant.
Check after every change
- Group Policy links
Links stay with the OU when it moves, but the OU stops inheriting policies from its old parent. Run
gpresult /ron a computer inside it. - Cloud Sync scope
Sync scope uses the OU's full path. A moved or renamed OU drops out of sync, and its accounts are deleted from Microsoft 365. Update the scope before you move a synced OU.
- Delegations
Permissions set on the old parent stop applying. Check with
dsacls "<new path>".
Deleting an OU
Empty it first, lift the protection, then delete it. The AD Recycle Bin from Finish the domain setup lets you restore it for 180 days.
$ou = "OU=CON-Old,OU=Contoso School,DC=ad,DC=contoso,DC=com" Get-ADObject -SearchBase $ou -SearchScope OneLevel -Filter * # must be empty Set-ADObject -Identity $ou -ProtectedFromAccidentalDeletion $false Remove-ADOrganizationalUnit -Identity $ou -Confirm:$false


