Hi all, I wanted to know if there is a way to silently deploy updates and simultaneously upgrade macOS devices. The script I found, prompts the users for the admin credentials to proceed, which disturbs the workflow as most of the users don’t know that. Is it possible to achieve silent update installation through a script?
Script to update and upgrade macOS devicesSolved
Replies (1)
Hi @Deborah. Thanks for reaching out on Hexnode Connect!
Yes, it’s possible to achieve silent update installation on macOS devices via scripts. You can use the following script to install OS updates via Hexnode’s Execute Custom Script feature:
1 |
sudosoftwareupdate -i -a -R |
Usually, minor updates or patches will not require admin credentials. However, if you want to deploy a major OS upgrade, the device will prompt for the admin credentials in some cases. This prompt can be avoided bypassing the admin credentials as a part of the following script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/bin/bash osVersion=<OS Version> installerPath="" majorVersion=$(echo$osVersion | cut -d"." -f1) minorVersion=$(echo$osVersion | cut -d"." -f2) if [ $majorVersion == "12" ];then installerPath="install macOS Monterey.app" elif [ $majorVersion == "11" ];then installerPath="Install macOS Big Sur.app" elif [ $minorVersion == "15"* ];then installerPath="Install macOS Catalina.app" fi fullPath="/Applications/$installerPath/Contents/Resources/startosinstall" softwareupdate --fetch-full-installer–full-installer-version$osVersion echo <Password> | "$fullPath" --agreetolicense --forcequitapps --nointeraction --user <Username> --stdinpass |
In the above script, please replace <OS Version> with the specific version of the operating system to which you wish to update. Similarly, replace <Username> and <Password> with the admin’s username and password, respectively. On executing the script, it accepts the desired OS version as input, installs the appropriate installer app for that version, and begins the installation process for the update. For more detailed explanation, please refer to our help documentation on scripts to deploy OS updates and upgrades. I hope this helps, please reach out to us in case of any further queries.
Regards,
Carl Hughes
Hexnode UEM