This script offers a streamlined and secure method for granting users temporary administrative rights through the JAMF Self Service. With a strong emphasis on modern command structures, precise logging, efficient cleanup, and user interaction, it provides an effective solution for administrators who want to empower their users temporarily without compromising system integrity.
Originally based on a script that was last updated five years ago, this revised version introduces significant enhancements:
-
Modern Command Implementation: Deprecated commands (
load
&unload
) have been replaced with their contemporary counterparts (bootstrap
&bootout
), ensuring compatibility with the latest macOS versions. -
User Confirmation: Before administrative rights are granted, users are presented with a confirmation dialog. This step ensures that users are consciously accepting the elevated permissions and are aware of the associated responsibilities.
-
Efficient Logging: The script incorporates a robust logging system that captures all administrative actions performed during the temporary admin session. For optimal storage, the logs are compressed, and older archives are automatically purged after six months.
-
Thorough Cleanup: All residues from previous script runs, such as lingering LaunchDaemons and the
removeAdmin
script, are diligently identified and removed. This cleanup process ensures a clean and conflict-free system environment. -
Direct User Identification: The revised script accepts the username directly as a parameter, eliminating any inaccuracies or inconsistencies that might arise from the older
who
command.
This modernization effort has been a collaborative initiative. Special thanks to:
- Pico from MacAdmins Slack for invaluable insights and guidance throughout the process.
This script is designed explicitly for integration with JAMF Self Service. To deploy:
- Ensure the JAMF Self Service is correctly set up in your environment.
- Add the script to your JAMF Self Service policies.
- Define the necessary parameters and triggers.
- Deploy to target machines.
Note: Always test scripts in a controlled environment before rolling out to production systems.