mirror of
https://github.com/wickedyoda/public-setupfiles.git
synced 2026-11-16 13:31:56 -06:00
add playbooks and power shell scripts
add playbooks and power shell scripts
This commit is contained in:
1 parent
377688e218
commit
4d5c390d46
9 files changed
+324
No files matched your search
@@ -0,0 +1,49 @@
|
||||
---
|
||||
- name: Restore shutdown, sleep, and hibernation options
|
||||
hosts: windows
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: Allow shutdown without logging on
|
||||
ansible.windows.win_regedit:
|
||||
path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\System
|
||||
name: ShutdownWithoutLogon
|
||||
data: 1
|
||||
type: dword
|
||||
state: present
|
||||
|
||||
- name: Remove shutdown and related restrictions set by policy
|
||||
ansible.windows.win_regedit:
|
||||
path: "{{ item.path }}"
|
||||
name: "{{ item.name }}"
|
||||
state: absent
|
||||
loop:
|
||||
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
|
||||
name: NoClose
|
||||
- path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\System
|
||||
name: DisableShutdownOption
|
||||
- path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
|
||||
name: NoShutdown
|
||||
- path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
|
||||
name: CloseSystemNoShutdown
|
||||
- path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
|
||||
name: DisableCACheck
|
||||
- path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
|
||||
name: DisableTaskMgr
|
||||
|
||||
- name: Restore automatic sleep and hibernation timeouts
|
||||
ansible.windows.win_command: "powercfg.exe /change {{ item.setting }} {{ item.minutes }}"
|
||||
loop:
|
||||
- setting: standby-timeout-ac
|
||||
minutes: 120
|
||||
- setting: standby-timeout-dc
|
||||
minutes: 120
|
||||
- setting: hibernate-timeout-ac
|
||||
minutes: 180
|
||||
- setting: hibernate-timeout-dc
|
||||
minutes: 30
|
||||
changed_when: true
|
||||
|
||||
- name: Enable hibernation
|
||||
ansible.windows.win_command: powercfg.exe /hibernate on
|
||||
changed_when: true
|
||||
Reference in new issue
Block a user