# Use a Windows base image
FROM mcr.microsoft.com/windows:1809
# Enable Remote Assistance by running PowerShell commands
RUN powershell -Command
$registryPath = 'HKLM:SYSTEMCurrentControlSetControlRemote Assistance';
New-Item -Path $registryPath -Force;
Set-ItemProperty -Path $registryPath -Name “fAllowToGetHelp” -Value 1 -Type DWORD;
Set-ItemProperty -Path $registryPath -Name "fAllowFullControl" -Value 1 -Type DWORD;
Set-ItemProperty -Path $registryPath -Name "fAllowRemoteInvitation" -Value 1 -Type DWORD;
Set-ItemProperty -Path $registryPath -Name "fEnableRADC" -Value 1 -Type DWORD;
Set-ItemProperty -Path $registryPath -Name "fOfferRemoteAssistance" -Value 1 -Type DWORD
# switch shell to powershell (note: pwsh not available on the image)
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; $ExecutionPolicy = 'Unrestricted';"]
# enable RDP (value is 1 on the base image)
RUN Set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal Server' -name "fDenyTSConnections" -value 0
#RUN Set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal Server' -Name 'fDenyTSConnections' -Type 'DWord' -Value 0
# per https://www.withinrafael.com/2018/03/09/using-remote-desktop-services-in-containers/
#RUN Set-ItemProperty -Path 'HKLM:SystemCurrentControlSetControlTerminal Server' -Name 'TemporaryALiC' -Type 'DWord' -Value 1
## Set registry settings to enable Remote Desktop
#RUN powershell -Command
# Set-ItemProperty -Path 'HKLM:SYSTEMCurrentControlSetControlTerminal Server' -Name "fDenyTSConnections" -Value 0 -Type DWORD;
# Set-ItemProperty -Path 'HKLM:SYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp' -Name "UserAuthentication" -Value 1 -Type DWORD
# Set the password for the default administrator account (Change this to your desired password)
RUN powershell -Command
net user Administrator yourpassword
# Expose RDP port
EXPOSE 3390
1