-
Notifications
You must be signed in to change notification settings - Fork 99
/
config.yml
702 lines (620 loc) · 23.2 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
# -*- coding: utf-8 -*-
# Copyright 2016, Dag Wieers <[email protected]>
#
# This playbook configures system-related settings. It is intended to
# be used on newly installed systems. Or whenever this playbook changes.
# Group Policies: https://msdn.microsoft.com/en-us/library/ms815238.aspx
- hosts: computers
gather_facts: no
tasks:
- name: Create Crombeen directory
win_file:
path: C:\Crombeen
state: directory
tags: winrm
- name: Copy ConfigureRemotingForAnsible.ps1 to system
win_copy:
src: ConfigureRemotingForAnsible.ps1
dest: C:\Crombeen\ConfigureRemotingForAnsible.ps1
tags: winrm
- name: Configure WinRM from daily scheduled task
win_scheduled_task:
name: ConfigureRemotingForAnsible
description: Run ConfigureRemotingForAnsible.ps1
start_when_available: yes
multiple_instances: 2
hidden: yes
enabled: yes
actions:
- path: powershell.exe
working_directory: C:\Crombeen\
arguments: -ExecutionPolicy Bypass -File "C:\Crombeen\ConfigureRemotingForAnsible.ps1" -CertValidityDays 3650 -EnableCredSSP -ForceNewSSLCert
triggers:
- type: boot
- type: daily
start_boundary: '2017-10-09T09:00:00'
username: NT AUTHORITY\SYSTEM
wake_to_run: yes
tags: winrm
- name: Copy CleanupUserAccount.ps1 to system
win_copy:
src: CleanupUserAccount.ps1
dest: C:\Crombeen\CleanupUserAccount.ps1
tags: cleanuser
- name: Clean up shared account from login scheduled task
win_scheduled_task:
name: CleanupUserAccount
description: Run CleanupUserAccount.ps1
start_when_available: yes
multiple_instances: 2
hidden: yes
enabled: yes
actions:
- path: powershell.exe
working_directory: C:\Crombeen\
arguments: -WindowStyle Minimized -ExecutionPolicy Bypass -File "C:\Crombeen\CleanupUserAccount.ps1"
triggers:
- type: logon
user_id: '{{ inventory_hostname|upper }}\leerling'
username: '{{ inventory_hostname|upper }}\leerling'
wake_to_run: yes
ignore_errors: yes
tags: cleanuser
- name: Log out user leerling after 15 mins
win_scheduled_task:
name: LogOffIdleUser
description: Log off idle user
start_when_available: yes
multiple_instances: 2
hidden: yes
enabled: yes
actions:
- path: shutdown.exe
working_directory: C:\Crombeen\
arguments: /l
triggers:
- type: idle
user_id: '{{ inventory_hostname|upper }}\leerling'
username: '{{ inventory_hostname|upper }}\leerling'
wake_to_run: yes
ignore_errors: yes
tags: cleanuser, logoffuser
# - name: Run ConfigureRemotingForAnsible.ps1
# win_shell:
# Powershell.exe -ExecutionPolicy Bypass -File "$env:LOCALAPPDATA\Crombeen\ConfigureRemotingForAnsible.ps1" -CertValidityDays 3650 -EnableCredSSP -ForceNewSSLCert
# register: winrm
# async: 45
# poll: 5
# tags: run-winrm
#
# - name: Wait for WinRM
# async_status: jid={{ winrm.ansible_job_id }}
# register: job_result
# until: job_result.finished
# retries: 30
- name: Registry configuration for ictadmin
win_regedit:
path: '{{ item.path }}'
name: '{{ item.name }}'
data: '{{ item.data|default(None) }}'
type: '{{ item.type|default("dword") }}'
state: '{{ item.state|default("present") }}'
with_items:
# Hostname configuration
- path: HKLM:\System\ControlSet001\Control\ComputerName\ActiveComputerName
name: ComputerName
data: '{{ inventory_hostname_short|lower }}'
type: string
- path: HKLM:\System\ControlSet001\Control\ComputerName\ComputerName
name: ComputerName
data: '{{ inventory_hostname_short|lower }}'
type: string
- path: HKLM:\System\ControlSet001\Services\Tcpip\Parameters
name: NV HostName
data: '{{ inventory_hostname_short|lower }}'
type: string
- path: HKLM:\System\ControlSet001\Services\Tcpip\Parameters
name: HostName
data: '{{ inventory_hostname_short|lower }}'
type: string
# Domain configuration
- path: HKLM:\System\ControlSet001\Services\Tcpip\Parameters
name: Domain
data: crombeen.internal
type: string
- path: HKLM:\System\ControlSet001\Services\Tcpip\Parameters
name: NV Domain
data: crombeen.internal
type: string
# Server description
- path: HKLM:\System\ControlSet001\Services\LanmanServer\Parameters
name: SrvComment
data: '{{ owner }}{{ " ("~role|title~")" if role is defined else "" }}{{ "" if type in [ "desktop"] else " ("~type|title~")" }}{{ " (Extra)" if "extra" in group_names else "" }} ({{ room }})'
type: string
# Disable empty-password restrictions
- path: HKLM:\SYSTEM\CurrentControlSet\Control\Lsa
name: LimitBlankPasswordUse
data: 0
# Disable all apps from Windows Store
- path: HKLM:\Software\Policies\Microsoft\WindowsStore
name: DisableStoreApps
data: 1
# Set primary keyboard layout to nl-BE
- path: HKU:\.DEFAULT\Keyboard Layout\Preload
name: '1'
data: 00000813
type: string
# Remove secondary keyboard layout
- path: HKU:\.DEFAULT\Keyboard Layout\Preload
name: '2'
state: absent
# Remove tertiary keyboard layouts
- path: HKU:\.DEFAULT\Keyboard Layout\Preload
name: '3'
state: absent
# Disable language hotkey
# 1 = Key Sequence enabled; use LEFT ALT+SHIFT to switch between locales.
# 2 = Key Sequence enabled; use CTRL+SHIFT to switch between locales.
# 3 = Key Sequences disabled.
- path: HKU:\.DEFAULT\Keyboard Layout\Toggle
name: Language Hotkey
data: 3
- path: HKU:\.DEFAULT\Keyboard Layout\Toggle
name: Layout Hotkey
data: 3
- path: HKU:\.DEFAULT\Keyboard Layout\Toggle
name: Hotkey
data: 3
- path: HKCU:\Keyboard Layout\Toggle
name: Language Hotkey
data: 3
- path: HKCU:\Keyboard Layout\Toggle
name: Layout Hotkey
data: 3
- path: HKCU:\Keyboard Layout\Toggle
name: Hotkey
data: 3
- path: HKCU:\Control Panel\Desktop
name: PreferredUILanguages
data: 'nl-BE'
type: multistring
# -path: HKCU:\Control Panel\Desktop
# name: PreferredUILanguagesPending
# data: 'nl-BE'
# type: multistring
# Windows 10 Registry Hacks: https://ss64.com/nt/syntax-reghacks.html
# System Tray - Show all icons (The default for this can be set under HKLM)
- path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
name: EnableAutoTray
data: 0
# Do not add "-Shortcut" text to the name of newly created shortcuts.
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
name: link
data: hex:00,00,00,00
type: binary
# Show all folders in Explorer including Recycle Bin, Desktop, Control Panel
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: NavPaneShowAllFolders
data: 0
# Show hidden files and folders
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: Hidden
data: 1
# Hide empty drives in My Computer folder
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: HideDrivesWithNoMedia
data: 0
# Do not hide file extensions
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: HideFileExt
data: 0
# Show hidden Operating System files
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: ShowSuperHidden
data: 2
# Remove Homegroup from Explorer
- path: HKLM:\SOFTWARE\Classes\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}
name: System.IsPinnedToNameSpaceTree
data: 0
# Prevent "Suggested Applications" to return
- path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent
name: DisableWindowsConsumerFeatures
data: 1
# Disable Cortana (Windows 10 Anniversary+)
- path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search
name: AllowCortana
data: 0
# Disable Microsoft Telemetry
- path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection
name: AllowTelemetry
data: 0
# Disable Game DVR and Game Bar
- path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR
name: AllowgameDVR
data: 0
# Enable lock timeout settings
# - path: HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\7516b95f-f776-4464-8c53-06167f40cc99\8EC4B3A5-6868-48c2-BE75-4F3044BE88A7
# name: Attributes
# data: 2
# Do not show notifications/adverts (OneDrive & new features) in Windows Explorer
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: ShowSyncProviderNotifications
data: 0
# Do not slow down search by including all public folders
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: Start_SearchFiles
data: 1
# Disable desktop trash bin
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel
name: '{645FF040-5081-101B-9F08-00AA002F954E}'
data: 1
# Disable task view button in taskbar
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: ShowTaskViewButton
data: 0
# Disable people button in taskbar
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People
name: PeopleBand
data: 0
# Show all tray icons
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
name: EnableAutoTray
data: 0
# Relocate User folders
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
name: My Music
data: \\diskstation01.crombeen.internal\Music
type: expandstring
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
name: My Video
data: \\diskstation01.crombeen.internal\Video
type: expandstring
tags: registry
- name: Registry configuration for user
win_regedit:
# hive: C:\Users\{{ user }}\NTUSER.DAT
path: '{{ item.path }}'
name: '{{ item.name }}'
data: '{{ item.data|default(None) }}'
type: '{{ item.type|default("dword") }}'
state: '{{ item.state|default("present") }}'
with_items:
# Disable Language Bar Hotkeys
- path: HKCU:\Keyboard Layout\Toggle
name: Language Hotkey
data: 3
- path: HKCU:\Keyboard Layout\Toggle
name: Layout Hotkey
data: 3
- path: HKCU:\Keyboard Layout\Toggle
name: Hotkey
data: 3
- path: HKCU:\Control Panel\Desktop
name: PreferredUILanguages
data: 'nl-BE'
type: multistring
# Show all folders in Explorer including Recycle Bin, Desktop, Control Panel
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: NavPaneShowAllFolders
data: 0
# Hide empty drives in My Computer folder
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: HideDrivesWithNoMedia
data: 0
# Do not hide file extensions
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: HideFileExt
data: 0
# Do not show notifications/adverts (OneDrive & new features) in Windows Explorer
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: ShowSyncProviderNotifications
data: 0
# Do not slow down search by including all public folders
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: Start_SearchFiles
data: 1
# Disable desktop trash bin
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel
name: '{645FF040-5081-101B-9F08-00AA002F954E}'
data: 1
# Disable task view button in taskbar
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
name: ShowTaskViewButton
data: 0
# Disable people button in taskbar
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People
name: PeopleBand
data: 0
# Show all tray icons
- path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer
name: EnableAutoTray
data: 0
# Disable and remove the Shut Down command (Leerling)
# - path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
# name: NoClose
# data: 1
# Disable changing wallpaper
# - path: HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop
# name: NoChangingWallPaper
# data: 1
# Disable Windows Remote UAC
# - path: HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System
# name: LocalAccountTokenFilterPolicy
# data: 1
# Enable Classic Shell
# - path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
# name: ClassicShell
# data: 1
# Enable connecting and disconnecting a LAN connection
# - path: HKCU:\Software\Policies\Microsoft\Windows\Network Connections
# name: NC_LanConnect
# data: 0
# Relocate User folders
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Folders
name: My Music
data: \\diskstation01.crombeen.internal\Music
type: expandstring
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Folders
name: My Video
data: \\diskstation01.crombeen.internal\Video
type: expandstring
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
name: My Music
data: \\diskstation01.crombeen.internal\Music
type: expandstring
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
name: My Video
data: \\diskstation01.crombeen.internal\Video
type: expandstring
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
name: '{A0C69A99-21C8-4671-8703-7934162FCF1D}'
data: \\diskstation01.crombeen.internal\Music
type: expandstring
- path: HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
name: '{35286A68-3C57-41A1-BBB1-0EAE73D76C95}'
data: \\diskstation01.crombeen.internal\Video
type: expandstring
become: yes
become_user: '{{ user }}'
#become_user: System
become_flags: logon_type=network
ignore_errors: yes
tags:
- registry
- userregistry
- name: Set Belgian keyboard (ictadmin)
win_shell: |
Set-Culture -CultureInfo nl-BE
Set-WinSystemLocale nl-BE
Set-WinHomeLocation -GeoId 21
Set-WinUILanguageOverride nl-BE
Set-WinUserLanguageList nl-BE -force
#$nl_BE = New-WinUserLanguageList -Language nl-BE
#$nl_BE.Remove("nl-NL")
#$nl_BE.Remove("en-US")
#$nl_BE[0].InputMethodTips.Clear()
#$nl_BE[0].InputMethodTips.Add('0813:00000813')
#Set-WinUserLanguageList -LanguageList $nl_BE -Force
ignore_errors: yes
tags: keyboard
- name: Set Belgian keyboard (System)
win_shell: |
Set-Culture -CultureInfo nl-BE
Set-WinSystemLocale nl-BE
Set-WinHomeLocation -GeoId 21
Set-WinUILanguageOverride nl-BE
Set-WinUserLanguageList nl-BE -force
become: yes
become_user: System
tags: keyboard
- name: Set Belgian keyboard ({{ user }})
win_shell: |
Set-Culture -CultureInfo nl-BE
Set-WinSystemLocale nl-BE
Set-WinHomeLocation -GeoId 21
Set-WinUILanguageOverride nl-BE
Set-WinUserLanguageList nl-BE -force
become: yes
become_user: '{{ user }}'
become_flags: logon_type=network
ignore_errors: yes
tags: keyboard
- name: Configure hostname, domain and workgroup
win_domain_membership:
hostname: '{{ inventory_hostname_short }}'
dns_domain_name: crombeen.internal
workgroup_name: CROMBEENGROUP
domain_admin_user: '{{ ansible_winrm_username }}'
domain_admin_password: '{{ ansible_winrm_password }}'
state: workgroup
ignore_errors: yes
tags:
- hostname
- workgroup
- name: Configure DNS servers
win_dns_client:
adapter_names: '*'
ipv4_addresses:
- 192.168.0.254
- 192.168.0.253
- 208.67.222.123
- 208.67.220.123
tags: dns
- name: Configure time zone
win_timezone:
timezone: Romance Standard Time
tags: timezone
- name: Disable Zune Music and Zune Video appx
win_shell: |
Get-AppxPackage -name "Microsoft.ZuneMusic" | Remove-AppxPackage
Get-AppxPackage -name "Microsoft.ZuneVideo" | Remove-AppxPackage
register: appx
changed_when: "'Deployment operation progress: ' in appx.stderr"
tags: vlc
- name: Enable VideoLan Client for Audio and Video files
win_regedit:
path: '{{ item.path }}'
name: '{{ item.name }}'
data: '{{ item.data|default(None) }}'
type: '{{ item.type|default("string") }}'
with_items:
- path: HKCR:\.aac\OpenWithProgids
name: VLC.aac
type: none
- path: HKCR:\.avi\OpenWithProgids
name: VLC.avi
type: none
- path: HKCR:\.iso\OpenWithProgids
name: VLC.iso
type: none
- path: HKCR:\.mkv\OpenWithProgids
name: VLC.mkv
type: none
- path: HKCR:\.mov\OpenWithProgids
name: VLC.mov
type: none
- path: HKCR:\.mp3\OpenWithProgids
name: VLC.mp3
type: none
- path: HKCR:\.mp4\OpenWithProgids
name: VLC.mp4
type: none
- path: HKCR:\.mp4v\OpenWithProgids
name: VLC.mp4v
type: none
- path: HKCR:\.mpeg\OpenWithProgids
name: VLC.mpeg
type: none
- path: HKCR:\.mpg\OpenWithProgids
name: VLC.mpg
type: none
- path: HKCR:\.vob\OpenWithProgids
name: VLC.vob
type: none
- path: HKCR:\.wma\OpenWithProgids
name: VLC.wma
type: none
- path: HKCR:\.wmv\OpenWithProgids
name: VLC.wmv
type: none
tags: vlc
# - name: Reset file associations (http://www.winhelponline.com/blog/windows-10-resetting-file-associations/)
# win_regedit:
# path: '{{ item.path }}'
# name: '{{ item.name }}'
# data: '{{ item.data|default(None) }}'
# type: '{{ item.type|default("string") }}'
# with_items:
# # Reset file associations
# - path: HKCU:\SOFTWARE\Classes\AppXvhc4p7vz4b485xfp46hhk3fq3grkdgjg
# name: NoOpenWith
# data:
# - path: HKCU:\SOFTWARE\Classes\AppXvhc4p7vz4b485xfp46hhk3fq3grkdgjg
# name: NoStaticDefaultVerb
# data:
# - path: HKCU:\SOFTWARE\Classes\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
# name: NoOpenWith
# data:
# - path: HKCU:\SOFTWARE\Classes\AppX43hnxtbyyps62jhe9sqpdzxn1790zetc
# name: NoStaticDefaultVerb
# data:
# tags: vlc
# - name: Disable hibernate option (removes hibernation file hiberfil.sys)
# win_shell: |
# powercfg.exe -h off
# tags: power
- name: Configure Chocolatey proxy
win_chocolatey_config:
name: proxy
value: http://192.168.0.253:3128/
tags: chocolatey
- name: Install printer driver
win_shell: |
Set-Location -Path "\\diskstation01.crombeen.internal\ictadmin\Hardware\Printer\Canon iR ADVANCE\PCL6_Driver_V2185_32_64_NL_07\x64\Driver"
PNPUtil.exe /add-driver CNP60HA64.INF /install
register: driver
changed_when: "'Added driver packages: 1' in driver.stdout"
failed_when: "'Driver package added successfully.' not in driver.stdout"
- name: Create printer
win_shell: |
Add-PrinterPort -Name "IP_192.168.0.40" -PrinterHostAddress "printer01.crombeen.internal" -PortNumber 9100 -ErrorAction SilentlyContinue
Add-PrinterDriver -Name "Canon iR-ADV C7260/7270 PCL6" -ErrorAction SilentlyContinue
Add-Printer -Name "iR-ADV C7260 (Crombeen)" -DriverName "Canon iR-ADV C7260/7270 PCL6" -Port "IP_192.168.0.40" -ErrorAction SilentlyContinue
ignore_errors: yes
- name: Rename printer
win_shell: |
( Get-Printer -Name "{{ item }}" ) -and ( Rename-Printer -Name "{{ item }}" -NewName "iR-ADV C7260" )
with_items:
- Canon Printer
- Canon iR-ADV C7055/C7065 Class Driver
- Canon
- name: Default to black-white printing ({{ user }}) for iR-ADV C7260
win_shell: |
Set-PrintConfiguration -PrinterName "iR-ADV C7260" -Color $false -Confirm:$false
ignore_errors: yes
- name: Disable default services
win_service:
name: '{{ item }}'
start_mode: disabled
state: stopped
with_items:
- diagnosticshub.standardcollector.service # Microsoft (R) Diagnostics Hub Standard Collector Service
- DiagTrack # Diagnostics Tracking Service
- dmwappushservice # WAP Push Message Routing Service (see known issues)
#- HomeGroupListener # HomeGroup Listener
#- HomeGroupProvider # HomeGroup Provider
- lfsvc # Geolocation Service
- MapsBroker # Downloaded Maps Manager
#- NetTcpPortSharing # Net.Tcp Port Sharing Service
- RemoteAccess # Routing and Remote Access
- RemoteRegistry # Remote Registry
- SharedAccess # Internet Connection Sharing (ICS)
- TrkWks # Distributed Link Tracking Client
- WbioSrvc # Windows Biometric Service
#- WlanSvc # WLAN AutoConfig
- WMPNetworkSvc # Windows Media Player Network Sharing Service
#- wscsvc # Windows Security Center Service
#- WSearch # Windows Search
- XblAuthManager # Xbox Live Auth Manager
- XblGameSave # Xbox Live Game Save Service
- XboxNetApiSvc # Xbox Live Networking Service
tags: services
- hosts: computerlokaal:extra:technieklokaal:computer53
gather_facts: no
tasks:
- name: Set timeout (monitor:30 mins, standby:90 mins)
win_shell: |
powercfg.exe /CHANGE monitor-timeout-ac 30
powercfg.exe /CHANGE standby-timeout-ac 90
tags: power
- hosts: smartboard
gather_facts: no
tasks:
- name: Set timeout (monitor:0 mins, standby:4 hrs)
win_shell: |
powercfg.exe /CHANGE monitor-timeout-ac 0
powercfg.exe /CHANGE standby-timeout-ac 240
tags: power
- hosts: computers:!computerlokaal:!extra:!technieklokaal:!smartboard
gather_facts: no
tasks:
- name: Set timeout (monitor:20 mins, standby:never)
win_shell: |
powercfg.exe /CHANGE monitor-timeout-ac 30
powercfg.exe /CHANGE standby-timeout-ac 0
when: type == 'laptop'
tags: power
- hosts: computers:!computerlokaal:!extra:!technieklokaal:!smartboard
gather_facts: no
tasks:
- name: Set timeout (monitor:20 mins, standby:never)
win_shell: |
powercfg.exe /CHANGE monitor-timeout-ac 60
powercfg.exe /CHANGE standby-timeout-ac 240
when: type == 'desktop'
tags: power
# - name: Set lock timeout to 90 minutes
# win_shell: |
# powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 60
# powercfg.exe /SETACTIVE SCHEME_CURRENT
# tags: power