Cleaned remains and little changes to setupRDP
This commit is contained in:
15
setupRDP.ps1
15
setupRDP.ps1
@@ -17,8 +17,21 @@ function SetupRDP {
|
||||
[bool] $enable
|
||||
)
|
||||
if ($enable) {
|
||||
EnableRDP
|
||||
# check if RPD is already enabled
|
||||
$RDPEnabled = (Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections").fDenyTSConnections
|
||||
if ($RDPEnabled -eq 0) {
|
||||
Write-Host "RDP is already enabled!"
|
||||
} else {
|
||||
EnableRDP
|
||||
}
|
||||
} else {
|
||||
DisableRDP
|
||||
# Check if RDP is already disabled
|
||||
$RDPEnabled = (Get-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections").fDenyTSConnections
|
||||
if ($RDPEnabled -eq 1) {
|
||||
Write-Host "RDP is already disabled!"
|
||||
} else {
|
||||
DisableRDP
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user