lib/jss/api_object/management_history.rb
def last_mdm_contact(ident, api: JSS.api)
        epochs = completed_mdm_commands(ident, api: api).map { |cmd| cmd.completed_epoch }
        epochs += failed_mdm_commands(ident, api: api).map { |cmd| cmd.failed_epoch }
        epoch = epochs.max
        epoch ? JSS.epoch_to_time(epoch) : nil
      end
# The time of the most recently completed or failed MDM command.
# (knowledge of a failure means the device communicated with us)
#
# For Mobile Devices, this seems to be the best indicator of the real
# last-contact time, since the last_inventory_update is changed when
# changes are made via the API.
#
# @param ident [Type] The identifier for the object - id, name, sn, udid, etc.
#
# @param api [JSS::APIConnection] The API connection to use for the query
#   defaults to the currently active connection
#
# @return [Time, nil] An array of completed MDMCommands
#
The time of the most recently completed or failed MDM command.
(knowledge of a failure means the device communicated with us)

For Mobile Devices, this seems to be the best indicator of the real
last-contact time, since the last_inventory_update is changed when
changes are made via the API.
The time of the most recently completed or failed MDM command . ( knowledge of a failure means the device communicated with us ) For Mobile Devices this seems to be the best indicator of the real last - contact time since the last_inventory_update is changed when changes are made via the API .
def last_mdm_contact(ident, api: JSS.api)
        epochs = completed_mdm_commands(ident, api: api).map { |cmd| cmd.completed_epoch }
        epochs += failed_mdm_commands(ident, api: api).map { |cmd| cmd.failed_epoch }
        epoch = epochs.max
        epoch ? JSS.epoch_to_time(epoch) : nil
      end
def last_mdm_contact ( ident , api : JSS . api ) epochs = completed_mdm_commands ( ident , api : api ) . map { | cmd | cmd . completed_epoch } epochs += failed_mdm_commands ( ident , api : api ) . map { | cmd | cmd . failed_epoch } epoch = epochs . max epoch ? JSS . epoch_to_time ( epoch ) : nil end
The time of the most recently completed or failed MDM command.
The time of the most recently completed or failed MDM command .
An array of completed MDMCommands
An array of completed MDMCommands
Time, nil
ident
The identifier for the object - id, name, sn, udid, etc.
The identifier for the object - id name sn udid etc .
api
The API connection to use for the query defaults to the currently active connection
The API connection to use for the query defaults to the currently active connection
the currently active connection