dear all,
I’m trying to script the procedure of renaming and disjoining a pc from domain.
I used docs.microsoft.com tips and scripts are like below:
Rename-computer –computername $oldname –newname $newname -DomainCredential $ADcred -PassThru -Verbose -Force
Remove-Computer -UnjoinDomainCredential $ADcred -PassThru -Verbose -Force
renaming is done well but in disjoin step there is strange error I couldn’t find out the reason:
failed to unjoin computer ‘pkstest25’ from domain ‘abc.gig’ with the following error message: no mapping between account names and security ids was done.
Would you please give me a hint that what the possible reason is?