Category filter
Manage Remote Desktop & Remote Assistance using scripts on Windows devices
Remote Desktop allows a local computer to remotely connect to and control a remote PC over a network connection, while Remote Assistance provides remote technical assistance to another user by controlling their computer over a network connection.
These tools help administrators resolve issues on their users ‘ devices quickly and efficiently without having to be physically present at the location. However, if your users do not actively need it, it would be ideal to disable it to prevent your devices from potential remote attacks. Using Hexnode’s Execute Custom Script action, you can enable or disable Remote Desktop and Remote Assistance connections on Windows devices seamlessly.
PowerShell script
Disable/Enable Remote Desktop
Use the following script to disable Remote Desktop on Windows devices.
1 2 |
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 1 Write-Output "Remote Desktop is disabled." |
To enable Remote Desktop on your Windows device, use the following script.
1 2 |
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0 Write-Output "Remote Desktop is enabled." |
Disable/Enable Remote Assistance
Use the following script to disable Remote Assistance on Windows devices.
1 2 |
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Value 0 Write-Output "Remote Assistance is disabled." |
To enable Remote Assistance on your Windows device, use the script mentioned below.
1 2 |
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Value 1 Write-Output "Remote Assistance is enabled." |