Module: Jamf::MacOSRedeployMgmtFramework::ClassMethods
- Defined in:
- lib/jamf/api/jamf_pro/mixins/macos_redeploy_mgmt_framework.rb
Overview
Class Methods
Class Method Summary collapse
-
.extended(extender) ⇒ Object
when this module is included, also extend our Class Methods.
Instance Method Summary collapse
-
#redeploy_mgmt_framework(target_ids, cnx: Jamf.cnx) ⇒ Hash{Integer => String}
Redeploy the Jamf Management framework to target Computers or members of ComputerGroups.
Class Method Details
Instance Method Details
#redeploy_mgmt_framework(target_ids, cnx: Jamf.cnx) ⇒ Hash{Integer => String}
Redeploy the Jamf Management framework to target Computers or members of ComputerGroups
IMPORTANT: This only re-deploys the Jamf binary and related framework. The MDM system must be functioning. The target computer(s) will not re-install the framework if they never recieve the MDM command.
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 |
# File 'lib/jamf/api/jamf_pro/mixins/macos_redeploy_mgmt_framework.rb', line 67 def redeploy_mgmt_framework(target_ids, cnx: Jamf.cnx) target_ids = target_ids.is_a?(Array) ? target_ids : [target_ids] target_comp_ids = if self == Jamf::Computer target_ids elsif self == Jamf::ComputerGroup group_ids = target_ids.is_a?(Array) ? target_ids : [target_ids] comp_ids = [] group_ids.each { |gid| comp_ids += JSS::ComputerGroup.fetch(id: gid).member_ids } comp_ids else raise Jamf::UnsupportedError, 'This method is only available for Jamf::Computer and Jamf::ComputerGroup' end results = {} target_comp_ids.uniq.compact.each do |comp_id| result = cnx.jp_post "#{REDEPLOY_RSRC}/#{comp_id}", Jamf::BLANK result = Jamf::OAPISchemas::RedeployJamfManagementFrameworkResponse.new result results[comp_id] = result.commandUuid rescue Jamf::Connection::JamfProAPIError => e results[comp_id] = "ERROR: #{e}" end results end |