“The local security authority cannot be contacted” – Remote Desktop

Published | 2 min read

Recently I had to restore a number of virtual machine servers from a previous snapshot. Unfortunately, the domain controller snapshot was taken at a different time to the other machines.

All seemed well as I logged on to each machine remotely with the domain administrator account. That was until one of them returned with the following error:

An authentication error has occurred. The Local Security Authority cannot be contacted.

This could be due to an expired password. Please update your password if it has expired. For assistance, contact your administrator or technical support.

The Local Security Authority cannot be contacted. This could be due to an expired password.

The error suggests that the password could have expired on the account. From Googling around it is apparently possible to log in with the local administrator account and reset the password. In my case, I couldn’t log in to the local account remotely and still got the same error above.

It was possible however to log in from the VMWare console and get access to the box. I was a bit reluctant to reset the domain administrator password considering I could log on to the other boxes. When logging on locally with the domain administrator account I got this error:

The trust relationship between this workstation and the primary domain failed.

So what causes this problem? Well, every 30 days the machine’s private secret which is shared with the domain controller changes. Unfortunately for me that private secret changed between the dates the snapshots were taken on the two machines.

The fix from Microsoft for this is to remove the computer from the domain controller and rejoin it but this isn’t always possible and is a bit heavy-handed.

To fix this you need to log on locally as the local administrator and run the following in PowerShell.

$credential = Get-Credential

You will be prompted for account credentials at this point. You should use the domain administrator account for this. Then run the following:

Reset-ComputerMachinePassword -Credential $credential -Server dc.dev.local

The server should be the hostname of the domain controller.

If this errors it might be because you are using PowerShell 2 instead of 3 which doesn’t support the credential parameter. In this case, just run this and you should be prompted for credentials.

Reset-ComputerMachinePassword -Server dc.dev.local

You should now be able to log in as the domain administrator again.

I haven’t tried it myself but others have also had success with the following command:

Test-ComputerSecureChannel -Repair -Credential $credential

If this gets you out of a tight spot please leave a comment below.

ALSO ON ALEXHYETT.COM

Stack vs Heap Memory - What are the differences?

Stack vs Heap Memory - What are the differences?

  • 30 November 2022
In modern programming languages such as C# or Java, we tend to take memory management for granted. Gone are the days when we need to call malloc to request enough memory for our variables. Luckily a lot of that is done for us by the runtimes so we do...
Code Katas: Can They Make You A Better Developer?

Code Katas: Can They Make You A Better Developer?

  • 21 November 2022
They say “practice makes perfect”, although I much prefer “practice makes improvement”. Either way, how do you practice being a programmer? If you are already working as a software developer then you will be getting some practice from working on larg...
Git Flow vs GitHub Flow

Git Flow vs GitHub Flow

  • 10 November 2022
Losing code that you have spent hours writing can be painful, which is why we use version control (or source control) to store our code and manage changes. Version control is even more important if you are working in a team, without it code, changes ...
I Posted on YouTube Consistently for 1 Month. This is What Happened!

I Posted on YouTube Consistently for 1 Month. This is What Happened!

  • 02 November 2022
As part of my creative sabbatical, I have been posting a new software development video on my YouTube channel every Monday and Friday. It takes a long time to grow on YouTube, and I knew this going in but I have been pleasantly surprised with my grow...
Bitwise Operators and WHY we use them

Bitwise Operators and WHY we use them

  • 26 October 2022
Bitwise operators are one of those concepts that a lot of programmers don’t understand. These are not used a great deal anymore so you can get away with not knowing them but they can still come in handy for a number of different scenarios. If you end...
8 Data Structures you NEED to Know

8 Data Structures you NEED to Know

  • 26 October 2022
You can get pretty far in programming without understanding Data Structures, but eventually, you are going to need to know them, understand how they work and when to use them. https://www.youtube.com/watch?v=SCkbQSPH--A What is a data structure? A da...
Binary Numbers Explained for Programmers

Binary Numbers Explained for Programmers

  • 21 October 2022
Everyone knows that computers run on ones and zeros. This is because CPUs are made up of billions of transistors, which are basically just on-off switches. Any code you write needs to be processed by a computer and therefore has to be converted to b...
Beginners Guide to Programming

Beginners Guide to Programming

  • 12 October 2022
A lot of my articles are aimed at intermediate to advanced developers, but as part of my creative sabbatical, I am working on creating content for those just starting out. So in this post I will be covering some of the many questions that beginner pr...