Though Remote PowerShell turn on Remote Desktop
#$cred = Get-Credential # Enter credentials for the remote system
$session = New-PSSession -ComputerName WDPHL19AVA01 #-Credential $cred
Invoke-Command -Session $session -ScriptBlock {
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name 'fDenyTSConnections' -Value 0
Enable-NetFirewallRule -DisplayGroup 'Remote Desktop'
Exit-PSSession}
Comments