This happens very often. Usually I was rejoining workstation/server to the domain. However it is easier way to do it.
- You have to log in to the server with a broken relationship.
- You have to know the name of Domain Controller (example: AD01)
$DomainCred = Get-Credential
Reset-ComputerMachinePassword -Server "AD01" -Credential $DomainCred
That’s all.