Skip to content

Commit

Permalink
Merge pull request #1130 from chef/windows_fixup
Browse files Browse the repository at this point in the history
Make sure to disable UAC on windows
  • Loading branch information
tas50 authored Nov 6, 2018
2 parents 5ada22a + 4b7f10e commit 1242c8e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions windows/2008r2.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"guest_os_type": "windows",
"install_command": "powershell.exe -Command \"(new-object Net.WebClient).DownloadString('https://omnitruck.chef.io/install.ps1') | iex; install\"",
"run_list": [
"packer::disable_uac",
"packer::cleanup",
"packer::defrag"
]
Expand Down
1 change: 1 addition & 0 deletions windows/2012r2.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"cookbook_paths": ["cookbooks"],
"guest_os_type": "windows",
"run_list": [
"packer::disable_uac",
"packer::vm_tools",
"packer::features",
"packer::enable_file_sharing",
Expand Down
1 change: 1 addition & 0 deletions windows/2016.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"cookbook_paths": ["cookbooks"],
"guest_os_type": "windows",
"run_list": [
"packer::disable_uac",
"packer::vm_tools",
"packer::features",
"packer::enable_file_sharing",
Expand Down
1 change: 1 addition & 0 deletions windows/7.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"guest_os_type": "windows",
"install_command": "powershell.exe -Command \"(new-object Net.WebClient).DownloadString('https://omnitruck.chef.io/install.ps1') | iex; install\"",
"run_list": [
"packer::disable_uac",
"packer::vm_tools",
"packer::features",
"packer::enable_file_sharing",
Expand Down
6 changes: 6 additions & 0 deletions windows/cookbooks/packer/recipes/disable_uac.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
registry_key 'HKEY_LOCAL_MACHINE\software\Microsoft\Windows\CurrentVersion\Policies\system' do
values [{
name: 'EnableLUA',
type: :dword,
data: 0, }]
end
7 changes: 5 additions & 2 deletions windows/cookbooks/packer/recipes/enable_remote_desktop.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
execute 'Enable RDP' do
command 'reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f'
registry_key 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server' do
values [{
name: 'fDenyTSConnections',
type: :dword,
data: 0, }]
end

execute 'Enable RDP firewall rule' do
Expand Down

0 comments on commit 1242c8e

Please sign in to comment.