On this page I will collect commands and short snippets on problems I encounter
Windows
Problem: “The trust relationship between this workstation and the primary domain failed”
Fix: Reset-ComputerMachinePassword -Server DomainController -Credential DomainAdmin
Active Directory
Running a domain controller on Hyper-V that is a member of the same AD domain. This can cause system clock to drift. To mitigate that you should force the DC with PDC Emulator role to sync from an external source and stop the Hyper-V time sync service:
1
2
3
4 w32tm /config /manualpeerlist:se.pool.ntp.org /syncfromflags:manual /reliable:yes /update
Restart-Service w32time
Stop-Service vmictimesync
Get-Service vmictimesync | Set-Service -StartupType Disabled
It is also possible to remove time sync in Hyper-V settings for the VM but, at least in older versions, that may cause the VM to start up without knowing the time.