Skip to main content

Disable RDP

Summary

The script is used to check whether RDP is enabled on the machine. If RDP is enabled, the script disables it by editing the Registry value.

Sample Run

TimeActionStatusLink
4:12:00 pm 20-Sep-22Disable RDPSuccess THENprovaltech.com/ovais.rashid
4:12:00 pm 20-Sep-22Disable RDP-0002RDP is Disabledprovaltech.com/ovais.rashid
4:11:59 pm 20-Sep-22Disable RDP-00011provaltech.com/ovais.rashid
4:11:59 pm 20-Sep-22Execute Powershell CommandSuccess THENprovaltech.com/ovais.rashid
4:11:59 pm 20-Sep-22Execute Powershell Command-0012Results returned to global variable #global:psresult# and saved in Documents tab of server.provaltech.com/ovais.rashid
4:11:59 pm 20-Sep-22Execute Powershell Command-0012Informational: GetFile command overwrote the server file C:/Kaseya/UserProfiles/162522262609191/GetFiles/../docs/psoutput.txt with the new contents from c:/provaltech/psoutput.txt in THEN step 2.provaltech.com/ovais.rashid
4:11:59 pm 20-Sep-22Execute Powershell Command-0011Powershell command completed!provaltech.com/ovais.rashid
4:11:51 pm 20-Sep-22Execute Powershell Command-0011Executing powershell "" -Command "(Get-ItemProperty -Path 'HKLM:/SYSTEM/CurrentControlSet/Control/Terminal Server').fDenyTSConnections" >"c:/provaltech/psoutput.txt"provaltech.com/ovais.rashid
4:11:51 pm 20-Sep-22Execute Powershell Command-0010Sending output to global variable.provaltech.com/ovais.rashid
4:11:51 pm 20-Sep-22Execute Powershell Command-0008New command variable is: -Command "(Get-ItemProperty -Path 'HKLM:/SYSTEM/CurrentControlSet/Control/Terminal Server').fDenyTSConnections"provaltech.com/ovais.rashid
4:11:51 pm 20-Sep-22Execute Powershell Command-0008Custom commands detected as (Get-ItemProperty -Path 'HKLM:/SYSTEM/CurrentControlSet/Control/Terminal Server').fDenyTSConnectionsprovaltech.com/ovais.rashid
4:11:42 pm 20-Sep-22Execute Powershell Command-0002Powershell is present.provaltech.com/ovais.rashid
4:11:39 pm 20-Sep-22Disable RDP0provaltech.com/ovais.rashid
4:11:39 pm 20-Sep-22Execute Powershell CommandSuccess THENprovaltech.com/ovais.rashid
4:11:39 pm 20-Sep-22Execute Powershell Command-0012Results returned to global variable #global:psresult# and saved in Documents tab of server.provaltech.com/ovais.rashid
4:11:39 pm 20-Sep-22Execute Powershell Command-0012Informational: GetFile command overwrote the server file C:/Kaseya/UserProfiles/162522262609191/GetFiles/../docs/psoutput.txt with the new contents from c:/provaltech/psoutput.txt in THEN step 2.provaltech.com/ovais.rashid
4:11:38 pm 20-Sep-22Execute Powershell Command-0011Powershell command completed!provaltech.com/ovais.rashid
4:11:31 pm 20-Sep-22Execute Powershell Command-0011Executing powershell "" -Command "(Get-ItemProperty -Path 'HKLM:/SYSTEM/CurrentControlSet/Control/Terminal Server').fDenyTSConnections" >"c:/provaltech/psoutput.txt"provaltech.com/ovais.rashid
4:11:31 pm 20-Sep-22Execute Powershell Command-0010Sending output to global variable.provaltech.com/ovais.rashid
4:11:31 pm 20-Sep-22Execute Powershell Command-0008New command variable is: -Command "(Get-ItemProperty -Path 'HKLM:/SYSTEM/CurrentControlSet/Control/Terminal Server').fDenyTSConnections"provaltech.com/ovais.rashid
4:11:31 pm 20-Sep-22Execute Powershell Command-0008Custom commands detected as (Get-ItemProperty -Path 'HKLM:/SYSTEM/CurrentControlSet/Control/Terminal Server').fDenyTSConnectionsprovaltech.com/ovais.rashid
4:11:24 pm 20-Sep-22Execute Powershell Command-0002Powershell is present.provaltech.com/ovais.rashid
4:11:15 pm 20-Sep-22Run Now - Disable RDPAdmin provaltech.com/ovais.rashid scheduled procedure Run Now - Disable RDP to run at Sep 20 2022 4:11 PMprovaltech.com/ovais.rashid

Dependencies

None

Process

First, the script checks if RDP is enabled. If RDP is enabled, the shell command will run to make changes to the Registry value and disable RDP. Then the script checks again if RDP is still enabled; if not, it provides logs indicating that RDP is disabled.

Output

Script Logs

Export Attachment

Attach the content XML VSA Export to this document.

Attachments

Procedure_Disable_RDP.xml