Categories
Uncategorized

RDP – An internal error has occurred

An internal error has occurred

I was working on another issue and upon resolving that issue and rebooting my VM on Azure, I can no longer RDP to that VM!

I am getting the “an internal Error has occurred” error message. Luckily, remote PowerShell still worked. I established a remote PowerShell session, and could not find any issue on this VM.

After doing some research, it appears that this VM may have lost access to a folder that contains the certificates. To reclaim permission, I ran the following Scripts:

icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c > c:\temp\BeforeScript_permissions.txt
takeown /f "C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys" /a /r
icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c /grant "NT AUTHORITY\System:(F)"
icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c /grant "NT AUTHORITY\NETWORK SERVICE:(R)"
icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c /grant "BUILTIN\Administrators:(F)"
icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys /t /c > c:\temp\AfterScript_permissions.txt
Restart-Service TermService -Force

Restart-Service got stuck for me at stoppending.

I need to find the PID of termservice from the tasklist

TaskList /svc /fi "Services eq TermService"

and then I force a TaskKill CMD with the PID associated with TermService to finish the restart of this service.

TaskKill /PID #pid number

As soon as the system has permission to read from that folder again, I was able to RDP to the VM without any issue.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s