Method: Jamf::MDM::ClassMethods#delete_user

Defined in:
lib/jamf/api/classic/api_objects/mdm.rb

#delete_user(targets, user, api: nil, cnx: Jamf.cnx) ⇒ Hash{Integer=>String}

Send a delete_user command to one or more targets

Parameters:

  • targets (String, Integer, Array<String,Integer>)

    @see .send_mdm_command

  • user (String)

    the username of the acct to delete

  • cnx (Jamf::Connection) (defaults to: Jamf.cnx)

    the API thru which to send the command

Returns:

  • (Hash{Integer=>String})

    Keys are the target device ids. Values depend on the kind of target:

    • Computers will have the udid of the command sent to that computer. The udid can be used to later retrieve info about the command.

    • Mobile Devices seem to only have one command udid returned - for the last device to have the command sent to it. (even in the Database, not just in the API). So instead, the Hash value is the status of the command for that device, most often ‘Command sent’

    Blank pushes do not generate return values, so Hash values are always ‘Command sent’ (an error will be raised if there are problems sending)



686
687
688
689
690
# File 'lib/jamf/api/classic/api_objects/mdm.rb', line 686

def delete_user(targets, user, api: nil, cnx: Jamf.cnx)
  cnx = api if api

  send_mdm_command targets, :delete_user, opts: { user_name: user }, cnx: cnx
end