Configuring Remote Desktop Connection with Credential Guard and Local Network Settings

For more detailed information on remote desktop connections, refer to the following resources:

Test Environment

  • Both machines have user accounts with passwords. The controlled machine uses a Microsoft account (different from a local account, affecting the username and password during remote login).
  • The machines are running Windows Professional or higher editions.
  • The test environment involves two hosts within the same local network. For non-local networks, solutions like ZeroTier or TailScale can be used for remote access.

Key Concepts

Understanding the differences between Windows user accounts is crucial:

  • Local Account: Used only for logging into the local system, lacks cloud synchronization features.
  • Microsoft Account (Cloud Account): Offers enhanced functionality such as setting backups and cross-device logins.

Three Codes

  • Windows local account and Microsoft account passwords are independent.
  • A PIN can be set for convenience when logging into Windows but cannot be used for remote authentication unless it matches the account password.

Setting Up the Controlled Machine

Enabling Remote Desktop Feature

Enable remote desktop functionality either through the GUI or CLI:

GUI Method

Go to settings or control panel and enable "Allow remote desktop connections to this computer."

CLI Method


# PowerShell
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\' -Name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

# CMD
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes

Configuring the Controlling Machine

Microsoft's MSTSC Software

Use the MSTSC tool to establish a remote connection:

  1. Open "Run" (Win+R).
  2. Type "mstsc" and press Enter.
  3. Input the IP address or hostname of the remote computer along with login credentials.

Handling Login Credentials

Ensure that you use the correct username and password for the appropriate account type:

  • If using a Microsoft account, input the associated password rather than a PIN.
  • For local accounts, ensure the correct password is entered.

Frequently Asked Questions

Password Errors

Ensure that the correct account type (local or Microsoft) is being used for authentication. Mixing these can lead to invalid credential errors.

Remembering Login Credentials

To store credentials for future sessions:

  • Scucessfully connect and log in once to store the credentials.
  • Disable Credential Guard if remembering credentials is required.

Disabling Credential Guard


# PowerShell Script
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Warning "Please run this script as an administrator."
    Exit
}

$regPath1 = "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa"
New-ItemProperty -Path $regPath1 -Name "LsaCfgFlags" -Value 0 -PropertyType DWord -Force | Out-Null

$regPath2 = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard"
New-ItemProperty -Path $regPath2 -Name "LsaCfgFlags" -Value 0 -PropertyType DWord -Force | Out-Null

Write-Host "Registry keys updated. Please restart your computer."
Pause

Hardware Adjustment Issues

When controlling a remote machine, certain hardware functionalities like brightness adjustments may not work directly. Workarounds include adjusting the brightness on the controlling machine instead.

Tags: mstsc CredentialGuard RemoteDesktop

Posted on Sun, 27 Sep 2026 16:09:18 +0000 by peachsnapple