Scenario: When cleaning up Active Directory accounts, you receive the following error:
Remove-ADUser : The directory service can perform the requested operation only on a leaf object.
Solution: Our issue is caused by mobile devices being attached within these user accounts. Instead for using the Remove-ADUser commandlet, use the Remove-ADObject with a -recursive commandlet to get ad objects, such as mobile devices, that are attached.
Remove-ADObject “CN=buhbye,OU=Disabled,DC=domain,DC=com” -confirm:$false -recursive