远程桌面文件
格式
key:type:value
Remote.RDP
authentication level:i:2
enablecredsspsupport:i:0
full address:s:1.2.3.4
username:s:MY_USER_NAME
password 51:b:010101
密码
Add-Type -AssemblyName System.Security
[System.Text.UnicodeEncoding]$encoding = [System.Text.Encoding]::Unicode
[byte[]]$passwordAsBytes = $encoding.GetBytes(YOUR_PASSWORD_HERE)
[byte[]]$passwordEncryptedAsBytes = [System.Security.Cryptography.ProtectedData]::Protect($passwordAsBytes, $null, [System.Security.Cryptography.DataProtectionScope]::CurrentUser)
[string]$passwordEncryptedAsHex = -join ($passwordEncryptedAsBytes | ForEach-Object { $_.ToString("X2") })
return $passwordEncryptedAsHex
ref:https://github.com/RedAndBlueEraser/rdp-file-password-encryptor
Ref
https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/clients/rdp-files