Skip to main content

Fix “The trust relationship between this workstation and the primary domain failed”

Windows 22 June 2022

This error appears at logon when the computer account password stored on the workstation no longer matches the one in Active Directory. It typically happens after restoring a virtual machine snapshot or an old backup, after the computer account was reset on the domain controller, or when a machine was offline for a long time. Nobody can log on with domain credentials until the secure channel is repaired.

Fix with PowerShell (preferred)

Log on with a local administrator account, open PowerShell as administrator and reset the machine account password against a domain controller:

Reset-ComputerMachinePassword -Server dc01 -Credential (Get-Credential)
Restart-Computer

Enter the credentials of a domain account allowed to reset computer passwords. The computer does not leave the domain and keeps its SID, group memberships and GPO links.

An equivalent command that also tests the channel first:

Test-ComputerSecureChannel -Repair -Credential (Get-Credential)

Fix with netdom

netdom.exe is included in Windows Server and in the RSAT tools for Windows clients. From an elevated command prompt:

netdom.exe resetpwd /server:dc01 /userD:administrator /passwordD *

Type the password when prompted and reboot the machine.

Last resort: rejoin the domain

If the reset fails, remove the computer from the domain (join a workgroup), reboot and join it again. From PowerShell:

Add-Computer -Credential DOMAIN\administrator -DomainName domain.local

Rejoining creates a new secure channel and keeps the existing computer object when the name is unchanged.

References: Reset-ComputerMachinePassword and Test-ComputerSecureChannel on Microsoft Learn. Related: IT support by GOLINE.

0 0 votes
Article Rating
Subscribe
Notify of

0 Comments
Oldest
Newest Most Voted
Goline It Services Logo

News

  • GOLINE is pleased to announce that it has achieved ESET Gold Partner status for 2027. The recognition follows the successful completion of ESET’s partner certification requirements and confirms GOLINE’s continued investment in cybersecurity expertise and professional development. ESET’s partner programme is designed to support companies working with its cybersecurity solutions through dedicated technical and sales resources, training and other partner services. For GOLINE, the achievement further strengthens its collaboration with ESET and its ability to integrate ESET security technologies into the cybersecurity solutions and services it provides to businesses. ESET solutions are already part of GOLINE’s cybersecurity portfolio, alongside technologies...
  • GOLINE SA is excited to announce a new partnership with NetApp, a global leader in cloud data services and storage solutions. This collaboration aims to help organizations modernize their IT infrastructure, streamline data management, and enhance performance across cloud and hybrid environments. Modern Data Solutions for Businesses Through this partnership, GOLINE integrates advanced data management solutions, enabling businesses to securely store, manage, and access critical information across cloud, on-premises, or hybrid setups. Clients can benefit from: Flexible and scalable storage solutions to meet growing data needs Simplified management of cloud and on-premises environments Enterprise-grade security for sensitive and mission-critical data...
  • GOLINE SA is proud to announce a new strategic partnership with Omnissa, a global leader in digital workspace platforms and Horizon Cloud Service solutions. This collaboration marks a significant step forward in helping organizations embrace secure, flexible, and high-performance work environments. Why Choose Omnissa for Your Business? The platform enables virtual desktops, applications, and unified endpoint management. Organizations can deploy scalable workspaces across cloud, hybrid, or on-premises setups. Key benefits include: Easy access to desktops and apps on any device Centralized management for Windows, macOS, iOS, Android, and ChromeOS Strong security with access controls and multi-factor authentication Automated scaling to...
  • Hosting Services
  • +41 (0)91 260 76 50
0
Would love your thoughts, please comment.x
()
x
| Reply