![]() ![]() # Runs jamf recon to send an updated inventory to the Jamf Pro server # Runs jamf manage to enforce the management framework using the latest available data from the Jamf Pro server # the script runs the following functions: # Once it has been verified that the /var/log/jamf.log file has not been modified for at least the last five minutes, # Checks to see if the /var/log/jamf.log file has been modified in the previous five minutes. # Once communication is verified, it takes the following actions: # The LaunchDaemon and accompanying script created by running this script verifies that the Mac can communicate with the Jamf Pro server. # Script for use with Jamf Pro when you want to trigger an update of the management framework, followed by an inventory update. This script is available below and also from GitHub at the following location: Both the script and LaunchDaemon are in the computer’s memory, so it’s possible to delete the files before the script unloads the LaunchDaemon from LaunchD. If the LaunchDaemon is unloaded before the script deletes the LaunchDaemon’s and script’s file, LaunchD will stop the script’s run at the point where the LaunchDaemon unload command occurred. Note: The order for deletion and unloading is important. Runs jamf recon to send an updated inventory to the Jamf Pro server.Runs jamf manage to enforce the management framework using the latest available data from the Jamf Pro server.Once it has been verified that the /var/log/jamf.log file has not been modified for at least the last five minutes, the script runs the following functions:.Checks to see if the /var/log/jamf.log file has been modified in the previous five minutes.Once communication is verified, it takes the following actions: Once triggered to run, the script stored in /var/root verifies that the Mac can communicate with the Jamf Pro server. Creates a script in /var/root which is triggered to run by the LaunchDaemon.I’ve written an example script, which does the following: ![]() For more details, please see below the jump. To run these tasks, I’m using a self-destructing LaunchDaemon and script. Send the Jamf Pro server an updated inventory.Enforce the Jamf Pro agent’s management framework.Make sure the Jamf Pro agent hasn’t run anything for at least the last five minutes.To address this, I want to use the following workflow: Don’t interfere with any other processes that Jamf Pro may be running at that time.Update the computer inventory record in Jamf Pro as soon as possible that the OS upgrade has occurred.An example of this would be following an OS upgrade. If there are no config values then a built-in default is used if available.Every so often, I need to have Jamf Pro perform actions where it’s difficult to arrange the timing and task order I want using the options available from the Jamf Pro server’s end. However, if you don’t also provide the users password using the pw: parameter, then the pw_fallback option will always be false.Īny values available via JSS.config will be used if they are not provided in the parameters. When using an existing token or token string, the username used to create the token will be read from the server. “eyJhdXR…6EKoo” from any source can also be used. # Tokens Instead of a user and password, you may specify a valid ‘token:’, which is either:Ī Jamf::Connection::Token object, which can be extracted from an active Jamf::Connection via its #token methodĪ valid token string e.g. If omitted, and running from an interactive terminal, the user is prompted as with :prompt If :stdinX, (where X is an integer) the password is read from the Xth line of e Jamf.stdin If :stdin, the password is read from the first line of stdin If :prompt, the user is promted on the commandline to enter the password for the :user. The pw: parameter also accepts the symbols :prompt, and : stdin If the URL doesn’t contain user and pw, they can be provided via the parameters, or left to default values. When using a URL, other parameters below may be specified, however host: and port: parameters will be ignored, since they came from the URL, as will user: and :pw, if they are present in the URL. Which is the same as: connect host: ' ', port: 8443, user: ' myuser ', pw: ' pass ' ![]() The first parameter may be a URL (must be https) from which the host & port will be used, and if present, the user and password E.g. IMPORTANT: http (non-SSL, unencrypted) connections are not allowed. Connect to the both the Classic and Jamf Pro APIs
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |