14 August, 2020

Enable RDP on MS Server Core installs...

 

RDP on a Core install is disabled by default - There are times where RDP to this instance will be needed.
These steps will enable RDP on a Server Core install.
RDP to a Core install. presents a CLI...

I'm not certain that the check for WIRM is needed (seems like it should be enmabled by default, on a Core server install), but I am in the habit of always checking, and enabling it, if it is not enabled...

Here are the particulars - If you need this info, no explanation is really called for here, beyond that the below value must be '0' (zero), by default, it is '1' (one).

System\CurrentControlSet\Control\Terminal Server fDenyTSConnections

 
$Target
= "FileAndPrintServer-02"
$TestCommand
= $null
$TestCommand
= Test-WSMan -ComputerName $Target

If
(!($TestCommand)){C:\SysInternals\PsExec.exe -s -nobanner \\$Target /accepteula cmd /c "c:\windows\system32\winrm.cmd quickconfig -quiet"}

#Before
Invoke-Command
-ComputerName $Target {cscript "C:\Windows\System32\scregedit.wsf" /ar /v}
   
Invoke-Command -ComputerName $Target {cscript "C:\Windows\System32\scregedit.wsf" /ar 0}

# After
Invoke-Command
-ComputerName $Target {cscript "C:\Windows\System32\scregedit.wsf" /ar /v}