Skip to content

disable_all_policies

Chris Lasell edited this page Oct 4, 2019 · 2 revisions

This will loop through and disable every policy in the JSS.

JSS::Policy.all_ids(:refresh) do |pol_id|
  pol = JSS::Policy.fetch id: pol_id
  next unless pol.enabled?

  pol.disable
  pol.save

  puts "Disabled Policy '#{pol.name}', id: #{pol_id} "
end
Clone this wiki locally