/chef/dev/cookbooks/ms_license_auditing.rb

https://bitbucket.org/tdaslengrd/cloud_services · Ruby · 21 lines · 19 code · 2 blank · 0 comment · 0 complexity · 834c5c79eb4676cf4e84639d9da5f5e2 MD5 · raw file

  1. directory 'C:\etc\scripts' do
  2. rights :full_control, 'Administrators'
  3. recursive true
  4. action :create
  5. not_if { ::Dir.exists?('C:\etc\scripts') }
  6. end
  7. remote_file 'C:\etc\scripts\MSLicenseUsageAudit.pa1.ps1' do
  8. source 'https://bitbucket.org/atsservicesrd/dev-test/raw/7a84c61cb0a0036d3bffcf3228aa48dc7f868aad/Scripts/MSLicenseUsageAudit.pa1.ps1'
  9. action :create
  10. not_if { ::File.exists?('C:\etc\scripts\MSLicenseUsageAudit.pa1.ps1') }
  11. end
  12. windows_task 'Test2amSchedule' do
  13. command 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe "C:\etc\scripts\MSLicenseUsageAudit.pa1.ps1"'
  14. run_level :highest
  15. frequency :daily
  16. frequency_modifier 1
  17. start_time "03:20"
  18. not_if {"schtasks.exe /Query /TN Test2amSchedule"}
  19. end