Files
windows-ansible/ansible/roles/win_client/tasks/rd_gateway.yml
T
2024-04-16 19:08:05 +00:00

58 lines
2.2 KiB
YAML

---
- name: RD Gateway setup
tags: client_rdgw
block:
- name: Local policy for 'Remote Desktop Users' group to log on through Remote Desktop Services
ansible.windows.win_user_right:
name: SeRemoteInteractiveLogonRight
users:
- Remote Desktop Users
action: add
# https://exchangepedia.com/2016/10/enable-remote-desktop-rdp-connections-for-admins-on-windows-server-2016.html
- name: Registry edit - fDenyTSConnections
ansible.windows.win_dsc:
resource_name: Registry
Ensure: Present
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
ValueName: fDenyTSConnections
ValueData: 0
PsDscRunAsCredential_username: Administrator
PsDscRunAsCredential_password: "{{ ansible_password }}"
- name: Registry edit - fSingleSessionPerUser
ansible.windows.win_dsc:
resource_name: Registry
Ensure: Present
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
ValueName: fSingleSessionPerUser
ValueData: 1
PsDscRunAsCredential_username: Administrator
PsDscRunAsCredential_password: "{{ ansible_password }}"
- name: Registry edit - SecurityLayer
ansible.windows.win_dsc:
resource_name: Registry
Ensure: Present
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
ValueName: SecurityLayer
ValueData: 0
PsDscRunAsCredential_username: Administrator
PsDscRunAsCredential_password: "{{ ansible_password }}"
- name: Registry edit - UserAuthentication
ansible.windows.win_dsc:
resource_name: Registry
Ensure: Present
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
ValueName: UserAuthentication
ValueData: 0
PsDscRunAsCredential_username: Administrator
PsDscRunAsCredential_password: "{{ ansible_password }}"
- name: Enable NetFireWallRule - “Remote Desktop”
tags: temp
ansible.windows.win_powershell:
script: |
Enable-NetFirewallRule -DisplayGroup “Remote Desktop”