We’ve all been in the situation where we have signed on to a computer only to find that its security relationship with the domain has failed. In the past we’d have to remove the computer from the domain and then join it back again to reestablish the relationship.
This involved two reboots (one to leave, one to join). If it was a server that took a while to boot, the process could take so long that we might even forget why we sat down to sign on to the computer in the first place.
Test-ComputerSecureChannel is one of those cool little PowerShell cmdlets that doesn’t get the recognition it deserves. Running the cmdlet by itself checks whether the relationship with the domain controller is still good. If it comes back True then everything is okay. If it comes back False then the relationship needs to be fixed.
Using Test-ComputerSecureChannel with the –credential –Repair options allows you to repair the relationship with the domain without any restarts. You run the command, sign out and then can sign in with your domain credentials. For example, to repair the relationship with the WINDOWSITPRO domain, issue the command:
Test-ComputerSecureChannel –credential WINDOWSITPRO\Administrator –Repair
When signed on as a local administrator.
Test-ComputerSecureChannel has been around since Windows Server 2008 R2.