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

Popular posts from this blog

Clearing DNS cache on vCenter Server Appliance

Start and stop services in vCenter Server Appliance

How to step by step in detail install ssh on cachyos