PowerShell Enable RDP Access


<# 
.SYNOPSIS     
    Set RDP Access Settings on Remote Computer 
.DESCRIPTION 
    Sets a registry setting on a remote computer to allow RDP access
.EXAMPLE  
    Enter the server name when prompted 
 Notes:
    Requires WinRM to access the remote machine/s and rights on that machine
#>   

$Server=Read-Host "Enter ServerName"

invoke-command $Server -Scriptblock {Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0}

2020 | Scott W. Head  |  Sr. Systems Admin | Certified Microsoft Windows Server Administrator