Apply System Updates during enrollment?

maiksanftenberg
Contributor II

This is more of an idea seeking question.
How do you guys handle System Updates from Apple on new enrolling devices?

We currently have a script snipped in place that actually only does an softwareupdate -i -a.

But I wonder if there is a more elegant way doing this?

1 REPLY 1

ShaunRMiller83
Contributor III

I do pretty much the same thing but since the systems in the environment I support are mixed in terms of OS. I use the below command.

Update: I should have added I run this as a script as the very last step of new systems.

#!/bin/bash

osvers=$(sw_vers -productVersion | awk -F. '{print $2}')

if [[ ${osvers} -lt 13 ]]; then
    softwareupdate --install --all

elif [[ ${osvers} -ge 13 ]]; then
    softwareupdate --install --all --restart
fi