Trust relationship failed after revert snapshot

When you restore VM (that belongs to a windows domain) from (an old enough) snapshot you'll get this error:

trust relationship between this machine and domain failed

This happens because domain controller periodically renews computer account password (and maybe few other things).

Is there any way to configure domain controller (or anything else) in such way that this doesn't happen? I don't care about security risks/etc -- all this is in controlled environment.

asked Mar 4, 2017 at 4:19

Trust relationship failed after revert snapshot

2

Two solutions:

  1. You can try the policy like @Harry mentioned to disable machine password:
    Reference: Domain member: Disable machine account password changes

Per the article: The Domain member: Disable machine account password changes policy setting determines whether a domain member periodically changes its computer account password. Setting its value to Enabled prevents the domain member from changing the computer account password. While not recommended for production environments, setting the value to Enabled his is what you would set the value at in your controlled environment which would eliminate the identified problem.

  1. Another way to handle it is using PowerShell. This won't prevent it from happening but will solve it, you can put it in a script and use:
    Test-ComputerSecureChannel –Server dc -Repair
    Reference: Test-ComputerSecureChannel

Trust relationship failed after revert snapshot

T-Heron

5,2797 gold badges25 silver badges51 bronze badges

answered Mar 4, 2017 at 6:58

Trust relationship failed after revert snapshot

ClumsyPuffinClumsyPuffin

3,7441 gold badge15 silver badges17 bronze badges

3

For those of us using a production domain controller, it's easier to do this on the VMs.

Set this in the registry to disable automatic machine account password changes: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Netlogon\Parameters] "DisablePasswordChange"=dword:00000001

If you ever get "The trust relationship between this workstation and the primary domain failed", one easy fix is to log in as local admin (or a domain account with network disconnected) and use the powershell Reset-ComputerMachinePassword cmdlet as follows:

$credential = Get-Credential
# Enter domain admin account when prompted
Reset-ComputerMachinePassword -Server ClosestDomainControllerNameHere -Credential $credential

answered Mar 19, 2018 at 23:07

Trust relationship failed after revert snapshot

Nick WestgateNick Westgate

2,9802 gold badges33 silver badges38 bronze badges

Trust relationship failed after revert snapshot
I had a VM snapshot/checkpoint running for several months in my test lab and after reverting the snapshot back I went to login to the machine and got the dreaded Trust relationship between this computer and the primary domain failed error message.  So I logged in as a local admin onto that machine, opened up an Administrative PowerShell window and entered the below commands.

$cred = Get-Credential – (enter domain admin account when prompted)
Reset-ComputerMachinePassword -Credential $cred -Server ada-dc-02.adatum.com.au

Replace the server at the end with a FQDN of one of your Domain Controllers.  As I wasn’t authenticated to the domain, I needed to enter my domain admin credentials by using the Get-Credential cmdlet and then using those stored credentials to issue the Reset-ComputerMachinePassword cmdlet.

So there you have it, no more re-joining a computer to the domain.

Post navigation

active-directoryhyper-vremote desktopsnapshot

I have a Windows Server 2008 R2 HyperV machine. I had to restore it to an old snapshot, and now I'm getting the following error when logging in through remote desktop using a domain ID:

"the trust relationship between this workstation and the primary domain failed"

I tried running

netdom resetpwd /s:server.company.lab /ud:na\domainAdminId /pd:password

But it didn't help. I tried resetting the password and rebooting the server, but it didn't help.

Any ideas?

Best Answer

Related Solutions

The trust relationship between workstation and domain fails for ASP.NET app as soon as the connection goes down

Having seen someone report the same error on this forum. I found I was able to fix the problem by editing the web.config file and removing

securityTrimmingEnabled="true"

from the


  
    
       

node.

Virtual Machine Snapshot revert issue

The snapshot version of the VM is old and the computer account's password is now mismatched with the domain database. The best way to avoid this is to not keep snapshots for a long period of time. The best practice is to try and remove snapshots after a short period of time, allowing the delta files to be merged with the original vmdk. In addition to losing sync with the domain, another downside of keeping snapshots for a long time is degraded VM performance, due to buildup of multiple deltas.

What happens when you revert a snapshot?

Well, reverting snapshots immediately activates the parent snapshot of the current state of the virtual machine. The current disk and memory states are discarded and restored as they were when you took that snapshot.

Does reverting to a snapshot delete it?

Reverting to the last snapshot will only discard all changes from the delta (snapshot) file, i.e. reset the snapshot to its initial stat. If you want to revert, and delete the snapshot, you'll have to do both steps, revert to the snapshot, and then delete this snapshot.

What causes domain trust relationship failure?

The most common cause of the trust relationship failing upon restoring a workstation or server is the computer account password had been changed between the last backup taken and the restore attempt.