you're reading...
Windows Server

Windows Server: The trust relationship between this workstation and the primary domain failed

This can be a bit of an issue when it happens on a server joined to an Active Directory domain. I recently restored a Windows Server 2008 R2 virtual server to an earlier version using a snapshot in Hyper-V, restarted the machine and when trying to log in using domain credentials I got the error ‘The trust relationship between this workstation and the primary domain failed’. This is generally OK on workstations as you can simply remove it from the domain and re-add it, but for servers you wouldn’t really want to do that as who knows what would happen in terms of services on there (more so if its a DC, DHCP server etc)

A good way to solve this on a Windows Server is using PowerShell’s Reset-ComputerMachinePassword cmdlet. The following is an example of the cmdlet syntax:

powershell-iconPS C:\> Reset-ComputerMachinePassword -Server <domaincontroller>

and the below is a working example, run this by logging onto the server as local admin:

powershell-iconPS C:\> Reset-ComputerMachinePassword -Server dc00

Another method to reset the computer account, and one I had to use for a Server 2008 R2 VM, is the following command run from either Powershell or command shell. Note that you have to elevate the command shell or Powershell to run as administrator

powershell-iconPS C:\>NETDOM RESETPWD /Server:<domaincontroller> /UserD:<domain admin username> /PasswordD<domain admin password>


No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: