Remote Desktop: Difference between revisions

From Omnia
Jump to navigation Jump to search
 
(7 intermediate revisions by the same user not shown)
Line 17: Line 17:
Set dimensions:
Set dimensions:
  mstsc /admin /w:1024 /h:768
  mstsc /admin /w:1024 /h:768
== mstsc shortcut ==
Location of shortcut:
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories
Shortcut name:
Remote Desktop Connection
-
target:
%windir%\system32\mstsc.exe
start in:
%windir%\system32\


==Remote Desktop Connection Usage==
==Remote Desktop Connection Usage==
Line 87: Line 103:
* <b>Show Options -> Experience -> check [x] Persistent bitmap caching</b>
* <b>Show Options -> Experience -> check [x] Persistent bitmap caching</b>
* Show Options -> Experience -> check [x] Reconnect if the connection is dropped
* Show Options -> Experience -> check [x] Reconnect if the connection is dropped
== Hide Connection Bar ==
Open your .rdp file in a text editor and set the value:
* Show connection bar in full screen: displayconnectionbar:i:1
* Hide connection bar in full screen: '''displayconnectionbar:i:0'''
* Start unpinned (auto-hide): Pair with pinconnectionbar:i:0 (or pinconnectionbar:i:1 to start pinned).
Helpful Shortcuts & Notes
* Bring up a hidden bar: Press '''Ctrl + Alt + Home''' during a full-screen session.
* Toggle full screen / windowed mode: Press '''Ctrl + Alt + Break''' (useful if you hide the bar completely and need a quick way out of full screen).


== Save Password ==
== Save Password ==
Line 118: Line 146:
  # or delete all RAS (Remote Access) credentials with:
  # or delete all RAS (Remote Access) credentials with:
  cmdkey /delete /ras
  cmdkey /delete /ras
=== Delete all Credentials ===
List credentials:
cmdkey /list | findstr Target
Delete credentials:
for /F "tokens=1,2 delims= " %G in ('cmdkey /list ^| findstr Target') do cmdkey /delete %H
Batch file:
<pre>
@echo off
cmdkey.exe /list > "%TEMP%\List.txt"
findstr.exe Target "%TEMP%\List.txt" > "%TEMP%\tokensonly.txt"
FOR /F "tokens=1,2 delims= " %%G IN (%TEMP%\tokensonly.txt) DO cmdkey.exe /delete:%%H
del "%TEMP%\List.txt" /f /q
del "%TEMP%\tokensonly.txt" /f /q
echo All credentials cleared.
pause
</pre>
Powershell:
<pre>
cmdkey /list | ForEach-Object {
  if ($_ -like "*Target:*") {
    cmdkey /delete:($_ -replace " ","" -replace "Target:","")
  }
}
</pre>


=== cmdkey help ===
=== cmdkey help ===
Line 222: Line 279:


Reference: <ref>https://learn.microsoft.com/en-us/answers/questions/1193136/logged-in-with-same-user-twice-in-remote-desktop-c</ref>
Reference: <ref>https://learn.microsoft.com/en-us/answers/questions/1193136/logged-in-with-same-user-twice-in-remote-desktop-c</ref>
== RDP File Settings ==
<pre>
;
;  WARNING WARNING WARNING
;  REMOVE ALL COMMENT LINES OR THE FILE WILL NOT WORK PROPERLY
;
; default.rdp with each setting explained in the comment above it.
; Each setting line has the form name:type:value, where i means an integer and s means a
; string.
;
; RDP files have no official comment syntax. The built-in Windows client (mstsc) is
; reported to skip these ';' lines, but the Microsoft Remote Desktop Store app rejects
; files that contain them. default.rdp is the original without comments.
;
; The file opens a full-screen desktop on one monitor, connecting directly to
; myserver.example.com. The settings are tuned for a 56 Kbps modem. Sound is off,
; and only the clipboard, smart cards and WebAuthn sign-in are shared with the remote
; machine.
;
; Sources: Microsoft's current RDP properties page, and its 2021 Windows Server version.
; Neither covers remoteappmousemoveinject or gatewaybrokeringtype.
;  https://learn.microsoft.com/en-us/azure/virtual-desktop/rdp-properties
;  https://web.archive.org/web/20211205101247/https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/rdp-files
; ===== Display =====
; Opens full screen. 1 would open in a window.
screen mode id:i:2
; Uses one monitor. 1 would span all monitors.
use multimon:i:0
; Remote session width in pixels. With desktopheight, the session is 1920 x 1080.
desktopwidth:i:1920
; Remote session height in pixels.
desktopheight:i:1080
; 24-bit color. 32 is the highest; 15 and 16 use less bandwidth.
session bpp:i:24
; The last window position. 1 means a normal, not maximized, window. The four numbers
; are its left, top, right and bottom edges. mstsc (Remote Desktop Connection, the
; built-in Windows client) also uses this to choose which monitor a full-screen session
; opens on.
winposstr:s:0,1,2180,133,3480,1030
; Shows the bar at the top of a full-screen session, with minimize, restore and close.
displayconnectionbar:i:1
; ===== Performance and visual effects =====
; The settings in this section match mstsc's "Modem (56 Kbps)" option on the Experience
; tab, the lowest-quality one. On an office network or VPN, choose "LAN" or "Detect
; connection quality automatically" there to get smooth fonts and normal visuals back.
; Tunes the session for a 56 Kbps modem. The other values are 2 low-speed broadband,
; 3 satellite, 4 high-speed broadband, 5 WAN, 6 LAN and 7 automatic detection.
connection type:i:1
; Network-type detection is off, so the modem profile above is used.
networkautodetect:i:0
; Automatic bandwidth detection is on, which is the default.
bandwidthautodetect:i:1
; Compresses RDP traffic.
compression:i:1
; Caches screen images on your local disk, so they are not sent again in later sessions.
bitmapcachepersistenable:i:1
; No desktop background.
disable wallpaper:i:1
; No ClearType font smoothing, so text looks more jagged.
allow font smoothing:i:0
; No composition effects such as transparency.
allow desktop composition:i:0
; Shows only an outline while you drag a window.
disable full window drag:i:1
; No menu or window animations.
disable menu anims:i:1
; No visual styles, so windows have a plain look.
disable themes:i:1
; Cursor effects such as blinking stay on.
disable cursor setting:i:0
; Uses RDP's more efficient video streaming when possible.
videoplaybackmode:i:1
; ===== Audio and keyboard =====
; Remote sound is not played. 0 would play it locally; 1 would play it on the remote
; machine.
audiomode:i:2
; Your microphone is not passed to the session.
audiocapturemode:i:0
; Windows key combinations such as Alt+Tab go to the remote machine only in full-screen
; mode.
keyboardhook:i:2
; ===== Device redirection =====
; Copy and paste work between your machine and the remote one.
redirectclipboard:i:1
; Your local smart cards can be used in the session.
redirectsmartcards:i:1
; Web sign-ins in the session, such as passkeys, security keys and Windows Hello, are
; handled on your local device.
redirectwebauthn:i:1
; Your printers are not shared.
redirectprinters:i:0
; Your serial (COM) ports are not shared.
redirectcomports:i:0
; The session uses the remote machine's location, not yours.
redirectlocation:i:0
; Point-of-sale devices, such as barcode scanners, are not shared.
redirectposdevices:i:0
; No local drives are shared. * would share all of them.
drivestoredirect:s:
; ===== Connection and security =====
; The remote host. No port is given, so the default 3389 is used.
full address:s:myserver.example.com
; Reconnects automatically if the connection drops.
autoreconnection enabled:i:1
; If the server's identity can't be verified, for example because its certificate is
; untrusted, you get a warning and choose whether to connect.
authentication level:i:2
; Uses saved credentials, if any, without asking.
prompt for credentials:i:0
; Client and server agree on the security protocol, such as TLS with Network Level
; Authentication. This is the default.
negotiate security layer:i:1
; Does not sign in with Microsoft Entra ID. This is the "Use a web account to sign in"
; checkbox in mstsc.
enablerdsaadauth:i:0
; Workspace reconnect is off. It reconnects all your disconnected apps and desktops from
; a published workspace, so it doesn't apply to a direct connection.
enableworkspacereconnect:i:0
; Used only in load-balanced server farms that hand you off to another server. It
; doesn't apply to a direct connection to one host.
use redirection server name:i:0
; ===== Shell and RemoteApp =====
; RemoteApp shows a single remote program instead of a full desktop.
; Full desktop, not a single program.
remoteapplicationmode:i:0
; Normal desktop. A path here would start that program instead of the desktop.
alternate shell:s:
; Starting folder for the alternate shell. Not used.
shell working directory:s:
; Not documented by Microsoft. It applies only to RemoteApp, so it has no effect here.
remoteappmousemoveinject:i:1
; ===== RD Gateway and Kerberos proxy =====
; None of these take effect, because no gateway is set.
; No Remote Desktop gateway.
gatewayhostname:s:
; Don't use a gateway. In effect this is the same as 0, but it also ticks the option to
; bypass the gateway for local addresses.
gatewayusagemethod:i:4
; How you would sign in to a gateway: "allow user to select later".
gatewaycredentialssource:i:4
; Use the administrator's default gateway settings, not settings in this file.
gatewayprofileusagemethod:i:0
; Don't reuse the same credentials for the gateway and the remote machine.
promptcredentialonce:i:0
; Not documented by Microsoft. mstsc writes 0 by default.
gatewaybrokeringtype:i:0
; The gateway is not used as a Kerberos proxy, which would let sign-in requests reach
; the domain controller through it.
rdgiskdcproxy:i:0
; No Kerberos proxy server.
kdcproxyname:s:
</pre>
== My RDP File ==
my default.rdp ::
<pre>
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:24
winposstr:s:0,1,2180,133,3480,1030
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:1
networkautodetect:i:0
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
remoteappmousemoveinject:i:1
disable wallpaper:i:1
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:1
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:mysystem.example.com
audiomode:i:2
redirectprinters:i:0
redirectlocation:i:0
redirectcomports:i:0
redirectsmartcards:i:1
redirectwebauthn:i:1
redirectclipboard:i:1
redirectposdevices:i:0
drivestoredirect:s:
autoreconnection enabled:i:1
authentication level:i:2
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:0
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
enablerdsaadauth:i:0
</pre>
=== Default RDP File Settings ===
Stored in My Documentes
default.rdp :: is empty
windows 11 default.rdp if you open mstsc and save ::
<pre>
screen mode id:i:2
use multimon:i:0
desktopwidth:i:1700
desktopheight:i:960
session bpp:i:32
winposstr:s:0,3,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:7
networkautodetect:i:1
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
remoteappmousemoveinject:i:1
disable wallpaper:i:0
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:
audiomode:i:0
redirectprinters:i:1
redirectlocation:i:0
redirectcomports:i:0
redirectsmartcards:i:1
redirectwebauthn:i:1
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:2
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:0
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
enablerdsaadauth:i:0
</pre>


== Issues ==
== Issues ==

Latest revision as of 17:16, 16 November 2026

RDP

Port: TCP 3389

mstsc

mstsc - Microsoft Terminal Services Client

To simulate Ctrl-Alt-Del use Ctrl-Alt-End.

To connect to an administering session:

mstsc <host> /admin

If using server 2003:

mstsc <host> /console

Set dimensions:

mstsc /admin /w:1024 /h:768

mstsc shortcut

Location of shortcut:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories

Shortcut name:

Remote Desktop Connection

-

target:

%windir%\system32\mstsc.exe

start in:

%windir%\system32\

Remote Desktop Connection Usage

[Image:Remote Desktop Connection Usage.png]

Enable remote desktop remotely

How can I remotely enable Remote Desktop on Windows Server 2003:

What you need to do is create the new RDP listening port via the registry:

1. Run REGEDIT on your XP workstation or on your Windows 2000/2003 Server.

2. Click on File, then choose "Connect Network Registry".

3. In the Select Computer search box either browse Active Directory to locate the remote server, or type its name in the dialog box.

Click Ok.

4. In the remote machine's registry browse to the following key:

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server

5. Under the Terminal Server key find the value named fDenyTSConnections (REG_DWORD). Change the value data from 1 (Remote Desktop disabled) to 0 (Remote Desktop enabled).

Click Ok.

6. Close Regedit.

7. Reboot the remote machine for the change to take effect. You can easily do so by opening a command prompt and typing the following command:

shutdown -m \\srv1 -r

Other references:

Enable Remote Desktop via Registry

enable_remote_desktop.reg:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server]
"fDenyTSConnections"=dword:00000000

Change RDP Port

How to change the listening port for Remote Desktop - http://support.microsoft.com/kb/306759

  1. Start Registry Editor.
  2. Locate and then click the following registry subkey:
  3. HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
  4. On the Edit menu, click Modify, and then click Decimal.
  5. Type the new port number, and then click OK.
  6. Quit Registry Editor.
  7. Restart the computer.

Increase Performance

  • Show Options -> Display -> Display Configuration -> 1024x768 or Full Screen
  • Show Options -> Display -> True Color (24 bit) or High Color (16 bit) or High Color (15bit)
  • Show Options -> Local Resources -> Remote audio -> Remote audio playback -> Do not play
  • Show Options -> Local Resources -> Remote audio -> Remote audio recording -> Do not record
  • Show Options -> Local Resources -> Local devices and resources -> uncheck [ ] Printers
  • Show Options -> Local Resources -> Local devices and resources -> uncheck [ ] Clipboard ** I tend to keep this one checked anyway **
  • Show Options -> Local Resources -> Local devices and resources -> More -> uncheck [ ] everything
  • Show Options -> Experience -> Performance -> Low-speed broadband (256 kbps-2Mbps) or Modem (56kbps)
  • Show Options -> Experience -> check [x] Persistent bitmap caching
  • Show Options -> Experience -> check [x] Reconnect if the connection is dropped

Hide Connection Bar

Open your .rdp file in a text editor and set the value:

  • Show connection bar in full screen: displayconnectionbar:i:1
  • Hide connection bar in full screen: displayconnectionbar:i:0
  • Start unpinned (auto-hide): Pair with pinconnectionbar:i:0 (or pinconnectionbar:i:1 to start pinned).


Helpful Shortcuts & Notes

  • Bring up a hidden bar: Press Ctrl + Alt + Home during a full-screen session.
  • Toggle full screen / windowed mode: Press Ctrl + Alt + Break (useful if you hide the bar completely and need a quick way out of full screen).

Save Password

Credential Manager

Run:

control /name Microsoft.CredentialManager

Control Panel:

search for "Credential Manager" and open "Windows Credentials"

cmdkey

cmdkey /generic:<target_name> /user:<username> /pass
cmdkey /G:<target_name> /U:<username> /P
# For remote desktop:  (use 'generic' instead of 'add')
# NOTE: password seems to not work from here, so go to credential manager in control panel, and edit there after - this seems to work!
cmdkey /generic:TERMSRV/myrdp.example.com /user:<username> /pass
cmdkey /generic:TERMSRV/myrdp.example.com /user:<domain>\<username> /pass:<password>
cmdkey /add:<target_name> /user:<username> /pass:<password>
# or to type in the password at prompt:
cmdkey /add:<target_name> /user:<username> /pass
cmdkey /list
cmdkey /delete:<target_name>
# or delete all RAS (Remote Access) credentials with:
cmdkey /delete /ras

Delete all Credentials

List credentials:

cmdkey /list | findstr Target

Delete credentials:

for /F "tokens=1,2 delims= " %G in ('cmdkey /list ^| findstr Target') do cmdkey /delete %H

Batch file:

@echo off
cmdkey.exe /list > "%TEMP%\List.txt"
findstr.exe Target "%TEMP%\List.txt" > "%TEMP%\tokensonly.txt"
FOR /F "tokens=1,2 delims= " %%G IN (%TEMP%\tokensonly.txt) DO cmdkey.exe /delete:%%H
del "%TEMP%\List.txt" /f /q
del "%TEMP%\tokensonly.txt" /f /q
echo All credentials cleared.
pause

Powershell:

cmdkey /list | ForEach-Object {
  if ($_ -like "*Target:*") {
    cmdkey /delete:($_ -replace " ","" -replace "Target:","")
  }
}

cmdkey help

C:> cmdkey /?

Creates, displays, and deletes stored user names and passwords.

The syntax of this command is:

CMDKEY [{/add | /generic}:targetname {/smartcard | /user:username {/pass{:password}}} | /delete{:targetname | /ras} | /list{:targetname}]

Examples:

  To list available credentials:
     cmdkey /list
     cmdkey /list:targetname

  To create domain credentials:
     cmdkey /add:targetname /user:username /pass:password
     cmdkey /add:targetname /user:username /pass
     cmdkey /add:targetname /user:username
     cmdkey /add:targetname /smartcard

  To create generic credentials:
     The /add switch may be replaced by /generic to create generic credentials

  To delete existing credentials:
     cmdkey /delete:targetname

  To delete RAS credentials:
     cmdkey /delete /ras

additional cmdline details from AI

To save Remote Desktop Connection (RDP) credentials through the command line, you can use the cmdkey command. This tool allows you to add, delete, or list saved credentials for various services, including RDP.

Here's how to save RDP credentials using cmdkey:

  1. Open Command Prompt as Administrator:
    • Search for "cmd" in the Start menu, right-click on "Command Prompt", and select "Run as administrator".
  2. Use the cmdkey command:
    • You'll need to specify the target name (the remote computer's name or IP address), username, and password. For example:
 cmdkey /add:<target_name> /user:<username> /pass:<password>
  • Replace <target_name> with the remote computer's name or IP address (e.g., TERMSRV/MyRemoteMachine).
  • Replace <username> with the user account you want to use to connect (e.g., MyDomain\MyUser).
  • Replace <password> with the corresponding password.
  • Optional: List saved credentials: You can list all saved credentials using cmdkey /list.
  • Optional: Delete credentials: You can delete a specific credential using cmdkey /delete:<target_name> or delete all RAS (Remote Access) credentials with cmdkey /delete /ras.

Example:

cmdkey /add:TERMSRV/MyRemoteMachine /user:MyDomain\MyUser /pass:MyPassword

This command will save the credentials for the user "MyDomain\\MyUser" with the password "MyPassword" for the remote machine "MyRemoteMachine".

ref: Google AI [1]

Credential Manager

Another way without changing GPO is advised on the neighbor site - it worked for me:

Warning! Nobody actually knows what these changes really do. Use at your own risk.

Go to Control Panel -> Credential Manager on the local computer you are trying to connect from.

You will see three sections:

Windows Credentials
Certificate-Based Credentials
Generic Credentials

Remove the credentials from Windows Credentials and add it to Generic Credentials.

ref: [2]

Restrict Remote Desktop Services users to a single Remote Desktop Servies session

Don't allow a user to login to a server with multiple sessions - this policy is just dumb!

Restrict Remote Desktop Services users to a single Remote Desktop Servies session: Enabled

This policy setting allows you to restrict users to a single Remote Desktop Services session.

If you enable this policy setting, users who log on remotely by using Remote Desktop Services will be restricted to a single session (either active or disconnected) on that server. If the user leaves the session in a disconnected state, the user automatically reconnects to that session at the next logon.

If you disable this policy setting, users are allowed to make unlimited simultaneous remote connections by using Remote Desktop Services.

If you do not configure this policy setting, this policy setting is not specified at the Group Policy level.

Supported on: At least Windows Server 2003

---

Here's how to disable multiple sessions for the same user account using the Group Policy Editor:

  1. Press the Windows key + R to open the Run dialog box.
  2. Type "gpedit.msc" (without quotes) and press Enter to open the Group Policy Editor.
  3. Navigate to Computer Configuration -> Administrative Templates -> Windows Components -> Remote Desktop Services -> Remote Desktop Session Host -> Connections.
  4. Double-click on "Restrict Remote Desktop Services users to a single Remote Desktop Services session" to open the policy settings.
  5. Select the "Enabled" option and click OK to save the changes.

Reference: [3]

RDP File Settings

;
;   WARNING WARNING WARNING
;   REMOVE ALL COMMENT LINES OR THE FILE WILL NOT WORK PROPERLY
;


; default.rdp with each setting explained in the comment above it.
; Each setting line has the form name:type:value, where i means an integer and s means a
; string.
;
; RDP files have no official comment syntax. The built-in Windows client (mstsc) is
; reported to skip these ';' lines, but the Microsoft Remote Desktop Store app rejects
; files that contain them. default.rdp is the original without comments.
;
; The file opens a full-screen desktop on one monitor, connecting directly to
; myserver.example.com. The settings are tuned for a 56 Kbps modem. Sound is off,
; and only the clipboard, smart cards and WebAuthn sign-in are shared with the remote
; machine.
;
; Sources: Microsoft's current RDP properties page, and its 2021 Windows Server version.
; Neither covers remoteappmousemoveinject or gatewaybrokeringtype.
;   https://learn.microsoft.com/en-us/azure/virtual-desktop/rdp-properties
;   https://web.archive.org/web/20211205101247/https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/rdp-files

; ===== Display =====

; Opens full screen. 1 would open in a window.
screen mode id:i:2

; Uses one monitor. 1 would span all monitors.
use multimon:i:0

; Remote session width in pixels. With desktopheight, the session is 1920 x 1080.
desktopwidth:i:1920

; Remote session height in pixels.
desktopheight:i:1080

; 24-bit color. 32 is the highest; 15 and 16 use less bandwidth.
session bpp:i:24

; The last window position. 1 means a normal, not maximized, window. The four numbers
; are its left, top, right and bottom edges. mstsc (Remote Desktop Connection, the
; built-in Windows client) also uses this to choose which monitor a full-screen session
; opens on.
winposstr:s:0,1,2180,133,3480,1030

; Shows the bar at the top of a full-screen session, with minimize, restore and close.
displayconnectionbar:i:1

; ===== Performance and visual effects =====
; The settings in this section match mstsc's "Modem (56 Kbps)" option on the Experience
; tab, the lowest-quality one. On an office network or VPN, choose "LAN" or "Detect
; connection quality automatically" there to get smooth fonts and normal visuals back.

; Tunes the session for a 56 Kbps modem. The other values are 2 low-speed broadband,
; 3 satellite, 4 high-speed broadband, 5 WAN, 6 LAN and 7 automatic detection.
connection type:i:1

; Network-type detection is off, so the modem profile above is used.
networkautodetect:i:0

; Automatic bandwidth detection is on, which is the default.
bandwidthautodetect:i:1

; Compresses RDP traffic.
compression:i:1

; Caches screen images on your local disk, so they are not sent again in later sessions.
bitmapcachepersistenable:i:1

; No desktop background.
disable wallpaper:i:1

; No ClearType font smoothing, so text looks more jagged.
allow font smoothing:i:0

; No composition effects such as transparency.
allow desktop composition:i:0

; Shows only an outline while you drag a window.
disable full window drag:i:1

; No menu or window animations.
disable menu anims:i:1

; No visual styles, so windows have a plain look.
disable themes:i:1

; Cursor effects such as blinking stay on.
disable cursor setting:i:0

; Uses RDP's more efficient video streaming when possible.
videoplaybackmode:i:1

; ===== Audio and keyboard =====

; Remote sound is not played. 0 would play it locally; 1 would play it on the remote
; machine.
audiomode:i:2

; Your microphone is not passed to the session.
audiocapturemode:i:0

; Windows key combinations such as Alt+Tab go to the remote machine only in full-screen
; mode.
keyboardhook:i:2

; ===== Device redirection =====

; Copy and paste work between your machine and the remote one.
redirectclipboard:i:1

; Your local smart cards can be used in the session.
redirectsmartcards:i:1

; Web sign-ins in the session, such as passkeys, security keys and Windows Hello, are
; handled on your local device.
redirectwebauthn:i:1

; Your printers are not shared.
redirectprinters:i:0

; Your serial (COM) ports are not shared.
redirectcomports:i:0

; The session uses the remote machine's location, not yours.
redirectlocation:i:0

; Point-of-sale devices, such as barcode scanners, are not shared.
redirectposdevices:i:0

; No local drives are shared. * would share all of them.
drivestoredirect:s:

; ===== Connection and security =====

; The remote host. No port is given, so the default 3389 is used.
full address:s:myserver.example.com

; Reconnects automatically if the connection drops.
autoreconnection enabled:i:1

; If the server's identity can't be verified, for example because its certificate is
; untrusted, you get a warning and choose whether to connect.
authentication level:i:2

; Uses saved credentials, if any, without asking.
prompt for credentials:i:0

; Client and server agree on the security protocol, such as TLS with Network Level
; Authentication. This is the default.
negotiate security layer:i:1

; Does not sign in with Microsoft Entra ID. This is the "Use a web account to sign in"
; checkbox in mstsc.
enablerdsaadauth:i:0

; Workspace reconnect is off. It reconnects all your disconnected apps and desktops from
; a published workspace, so it doesn't apply to a direct connection.
enableworkspacereconnect:i:0

; Used only in load-balanced server farms that hand you off to another server. It
; doesn't apply to a direct connection to one host.
use redirection server name:i:0

; ===== Shell and RemoteApp =====
; RemoteApp shows a single remote program instead of a full desktop.

; Full desktop, not a single program.
remoteapplicationmode:i:0

; Normal desktop. A path here would start that program instead of the desktop.
alternate shell:s:

; Starting folder for the alternate shell. Not used.
shell working directory:s:

; Not documented by Microsoft. It applies only to RemoteApp, so it has no effect here.
remoteappmousemoveinject:i:1

; ===== RD Gateway and Kerberos proxy =====
; None of these take effect, because no gateway is set.

; No Remote Desktop gateway.
gatewayhostname:s:

; Don't use a gateway. In effect this is the same as 0, but it also ticks the option to
; bypass the gateway for local addresses.
gatewayusagemethod:i:4

; How you would sign in to a gateway: "allow user to select later".
gatewaycredentialssource:i:4

; Use the administrator's default gateway settings, not settings in this file.
gatewayprofileusagemethod:i:0

; Don't reuse the same credentials for the gateway and the remote machine.
promptcredentialonce:i:0

; Not documented by Microsoft. mstsc writes 0 by default.
gatewaybrokeringtype:i:0

; The gateway is not used as a Kerberos proxy, which would let sign-in requests reach
; the domain controller through it.
rdgiskdcproxy:i:0

; No Kerberos proxy server.
kdcproxyname:s:

My RDP File

my default.rdp ::

screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:24
winposstr:s:0,1,2180,133,3480,1030
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:1
networkautodetect:i:0
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
remoteappmousemoveinject:i:1
disable wallpaper:i:1
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:1
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:mysystem.example.com
audiomode:i:2
redirectprinters:i:0
redirectlocation:i:0
redirectcomports:i:0
redirectsmartcards:i:1
redirectwebauthn:i:1
redirectclipboard:i:1
redirectposdevices:i:0
drivestoredirect:s:
autoreconnection enabled:i:1
authentication level:i:2
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:0
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
enablerdsaadauth:i:0

Default RDP File Settings

Stored in My Documentes

default.rdp :: is empty

windows 11 default.rdp if you open mstsc and save ::

screen mode id:i:2
use multimon:i:0
desktopwidth:i:1700
desktopheight:i:960
session bpp:i:32
winposstr:s:0,3,0,0,800,600
compression:i:1
keyboardhook:i:2
audiocapturemode:i:0
videoplaybackmode:i:1
connection type:i:7
networkautodetect:i:1
bandwidthautodetect:i:1
displayconnectionbar:i:1
enableworkspacereconnect:i:0
remoteappmousemoveinject:i:1
disable wallpaper:i:0
allow font smoothing:i:0
allow desktop composition:i:0
disable full window drag:i:1
disable menu anims:i:1
disable themes:i:0
disable cursor setting:i:0
bitmapcachepersistenable:i:1
full address:s:
audiomode:i:0
redirectprinters:i:1
redirectlocation:i:0
redirectcomports:i:0
redirectsmartcards:i:1
redirectwebauthn:i:1
redirectclipboard:i:1
redirectposdevices:i:0
autoreconnection enabled:i:1
authentication level:i:2
prompt for credentials:i:0
negotiate security layer:i:1
remoteapplicationmode:i:0
alternate shell:s:
shell working directory:s:
gatewayhostname:s:
gatewayusagemethod:i:4
gatewaycredentialssource:i:4
gatewayprofileusagemethod:i:0
promptcredentialonce:i:0
gatewaybrokeringtype:i:0
use redirection server name:i:0
rdgiskdcproxy:i:0
kdcproxyname:s:
enablerdsaadauth:i:0

Issues

Error:

The security database on the server does not have a computer account for this workstation trust relationship

Solution:

  • RDP was setup with the new security settings
    • Use a Vista, Win7 or above system to connect
    • Reduce the RDP security settings

keywords