RDP文件快速远程桌面连接

远程桌面

Posted by JS on December 26, 2023

背景

Windows自带远程桌面每次登录需要输入账号密码,比较麻烦。

当然也可以第一次登录时直接保存密码,但只能保存到本地电脑,无法拷贝到其他电脑;

如果经常需要远程操作多台电脑的话,还是要每次输入账号密码。

可以将用户名和加密后的密码保存到rdp文件中,直接运行rdp文件进行远程桌面连接。

rdp文件

记事本打开 rdp 文件,在文件任意位置(另起一行)加入下列两行即可:


username:s:登录账号
password 51:b:加密后的密码

密码加密

使用PowerShell生成密码


("password" | ConvertTo-SecureString -AsPlainText -Force) | ConvertFrom-SecureString

rdp文件内容


screen mode id:i:2
use multimon:i:0
desktopwidth:i:1920
desktopheight:i:1080
session bpp:i:32
winposstr:s:0,1,324,0,1468,1040
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
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:MyServer IP
audiomode:i:0
redirectprinters:i:1
redirectcomports:i:0
redirectsmartcards: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:
redirectwebauthn:i:1
enablerdsaadauth:i:0
drivestoredirect:s:
username:s:user
password 51:b:01000000d08c9ddf0115d1118c7a00c04fc297eb010000005e996bba89f20e43a37724d5b7476fda00000000020000000000106600000001000020000000a0f9a05490868f864bf8c257ceda336501521e31ffaa9e0c92b7540b10d00b22000000000e800000000200002000000090b43e4d280d6f715ff6081ad0568a216d32e72397a9b24d5fe120e58ed9bee610000000dbc7e5e59570069ecb49a46596d8ca90400000006870c3729b4e3f70039ca7b0787ec7cfa12f83d63547113ba116849f7ed8c390ff725e098bd22fc953e2f3f745ff12143492bf067b8bc379133a1c31b610bd6e

参考

  • https://vircloud.net/operations/rdp-auto-login.html