If you attempt to remote desktop (RDP) to a Windows machine on a domain, you may receive an error message about a trust relationship failing which prevents you from logging in.
The Trust Relationship Between This Workstation and the Primary Domain Failed.
*If this is physical machine, disconenct the machine from the network and login with the last password of the user account as well. This is known as the cached password method.
If you know the Administrator password to the local machine, try the steps below. If you do not know this, you will have to remove and re-join the machine to the domain.
Note: If you do not know the local username/password but have direct access to the machine and logged into it prior with your domain account, disconnect the network connection (unplug cable or turn off wireless) and login with your domain credentials. This will allow you to login. Windows keeps your last known cache domain credentials stored in memory.
- Login to the machine using the combination below.
Username: .\administrator (or local username you know exists)
Password: (local password)
- Open Windows PowerShell as administrator (must be PowerShell 3 or higher) and type these commands.
Run this first:
Repair -Credential (get-credential)
Next, your Domain Admin Account (DOMAIN\USER):
$credential = Get-Credential
ClosestDomainControllerNameHere -Credential $credential