When I run this command: Remove-ADComputer -identity $computername
I get this message: "The directory service can perform the requested operation only on a leaf object."
This is because ADUC tells me in the "Confirm Subtree Deletion" window that "Object $computername contains objects."
The solution I found on the internet is to use the -recursive switch. Is this a safe action in order to delete only the specific computer from ADUC? Safe is my keyword. That is my concern at my new job.
Remove-ADComputer -identity $computername -recursive