I am able to use the native add-computer cmdlet to join a computer to a domain, but it seems that this cmdlet fails if the systems already exists in AD, and you are trying to add it to a different domain.
I would like to delete the existing object with powershell. Is this possible without loading the Active Directory Module? I am doing all this as part of system deployment, and don't want to have to load any additional windows features.
EDIT: This will need run in a way where I can pass credentials to the command. It will be run in the context of a local user.