Change the title bar of an RDP session launched from Powershell


TOtally new to Powershell but was asked to try and create a script that will launch an RDP Session on a remote server for my users.

I have managed to do this using the following and this works fine:-


Pre-Reqs Checks.

$PuttyPath=“C:\Program Files\PuTTY\Putty.exe”
IF(Test-Path “${PuttyPath}”){
} ELSE {
Read-Host “You either do not have putty installed or the path to the Putty executable is not installed in the default location.”
Read-Host “Please validate Putty is installed (if not download from here and install using the default values : ) or modify the path in this script to the correct location where you installed it.”

Setting the password to be used for the SSH bastion authentication.

$Value=Read-Host “Please enter your UK1HCC Password” -AsSecureString

Creating the SSH tunnel.

$ArgumentList="-ssh "${AWSUserName}@uk1hcc@${BastionSSH}" -pw "$Password" -L ${LocalPort}:${ServerIP}:3389"
$PuttyPath=“C:\Program Files\PuTTY\Putty.exe”
IF($PuttyInstalled -eq “Yes”){
Start-Process “${PuttyPath}” -ArgumentList $ArgumentList
Start-Sleep -Seconds 1

Creation of the RDP connection.

$mtscArgList="/v${LocalPort} /f"
Start-Process “C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories\Remote Desktop Connection” -ArgumentList $mtscArgList

My issue that no matter how much I read I cannot resolve is that once the rdp session has launched from this in the title bar of the rdp window it displays Remote Desktop Connection.

What I am looking for is the name of the server to be displayed in the title bar instead of the IP address and Port Number.

If anyone could offer any advice on this it will be much appreciated.

I dont think that is easily done. I saw nothing as an argument to the RDP exe or a setting in the connection file if you chose to use that.

There is mention in google of setting up DNS Aliases (or the local hosts file) and using that to get the wanted description.

1 Like