Apple automation macOS xcode

Cool Clicks, Swift Kicks: Unleash Peak Mac Performance for a Smoother Ride!

As Intune admins, keeping our devices humming along smoothly is a top priority. That means not just security, but also peak performance. One often-forgotten hero in this fight? Strategic reboots! They apply updates, clear out cobwebs, and generally get Macs back on track. But manually clicking "restart" across

โ€ข 8 min read
Cool Clicks, Swift Kicks: Unleash Peak Mac Performance for a Smoother Ride!

As Intune admins, keeping our devices humming along smoothly is a top priority. That means not just security, but also peak performance. One often-forgotten hero in this fight? Strategic reboots! They apply updates, clear out cobwebs, and generally get Macs back on track. But manually clicking "restart" across hundreds of devices? No thanks.

Today, we're ditching the click-fest and taking a ride on the "Cool Clicks, Swift Kicks" train! It's all thanks to a custom Bash script designed specifically for macOS that orchestrates automated reboots. Let's see how to unleash peak Mac performance for a smoother user experience for everyone!


The Challenge of Uptime Management

Uptime, it's a double-edged sword for Intune admins, right? On one hand, a rock-solid system is great, but on the other, those Macs can get bogged down without a refresh. Manually tracking reboots for hundreds of devices is a click-happy nightmare we all want to avoid.

That's where "Cool Clicks, Swift Kicks" comes in! This custom Bash script automates Mac reboots, ensuring optimal performance and adherence to IT policies. It's the one-click solution to keeping your Mac fleet running smoothly, freeing you up for more strategic tasks. Let's dive into the details!

Introducing the Custom Bash Script

Now that we've explored the uptime tightrope walk, let's introduce the solution that eliminates the manual clicking tightrope altogether: the Bash script!

This script is your secret weapon for automating Mac reboots across your entire MDM-managed fleet. It takes the reins on monitoring system uptime and intelligently prompts users when it's time for a refresh. No more endless clicking or worrying about missed updates โ€“ just smooth sailing!

Here's what makes script the ultimate reboot maestro:

So, ditch the manual reboot click-a-thon and let automation take the wheel! It's time to unleash peak Mac performance and keep your users productive, all while ensuring top-notch device security thanks to those crucial updates.


Behind the Scenes

Now that you've met the script, let's peek under the hood and see how it orchestrates these automated Mac reboots!

The script operates on a tiered system, taking a user-friendly approach to prompting reboots. Here's how it tailors notifications based on uptime:


Deployment and Customization

Deploying this script through your MDM platform is a breeze. You can push it as a custom script, meaning it runs at specific intervals you define. Alternatively, you can configure it to trigger based on specific events, like system startup (by hardcoding in the script). This ensures the script is always on the lookout for optimal reboot times.

Pre-requisites: Ensuring Smooth Deployment

Before diving into the world of automated reboots and streamlined device management, there's a crucial step every MDM admin must undertake: deploying swiftDialog. This tool is the linchpin of our script, enabling it to communicate with users through polished, native macOS notifications and dialog boxes.

Why swiftDialog?

swiftDialog serves as a bridge between our script's logic and the user's experience, offering a customizable and interactive interface that far surpasses standard notification capabilities. Its versatility allows us to craft messages that can't be ignored, ensuring our reboot prompts are both seen and acted upon.

Deploying swiftDialog with MDM:

To integrate swiftDialog into your macOS fleet, you'll deploy it using your MDM solution. While the exact steps will depend on your specific MDM platform, the essence is the same: package swiftDialog as an enterprise app and push it to your devices as a mandatory install with the required configuration. Here is the example, how I am deploying it:

๐Ÿ’ก
This pre-deployment step is crucial. Without swiftDialog properly installed on the target, the script functionality will fail.
<key>PayloadContent</key>
<array>
    <dict>
        <key>PayloadDisplayName</key>
        <string>Notifications Payload</string>
        <key>PayloadIdentifier</key>
        <string>018e529a-e5ad-70f3-aabc-8bc88f3f1b5e</string>
        <key>PayloadOrganization</key>
        <string>IRL</string>
        <key>PayloadType</key>
        <string>com.apple.notificationsettings</string>
        <key>PayloadUUID</key>
        <string>018e529a-ad64-7e38-bcf5-41dc654b5910</string>
        <key>PayloadVersion</key>
        <integer>1</integer>
        <key>NotificationSettings</key>
        <array>
            <dict>
                <key>AlertType</key>
                <integer>1</integer>
                <key>BadgesEnabled</key>
                <true/>
                <key>BundleIdentifier</key>
                <string>au.bartreardon.dialog</string>
                <key>CriticalAlertEnabled</key>
                <true/>
                <key>NotificationsEnabled</key>
                <true/>
                <key>ShowInLockScreen</key>
                <true/>
                <key>ShowInNotificationCenter</key>
                <true/>
                <key>SoundsEnabled</key>
                <true/>
            </dict>
            <dict>
                <key>AlertType</key>
                <integer>1</integer>
                <key>BadgesEnabled</key>
                <true/>
                <key>BundleIdentifier</key>
                <string>au.csiro.dialog</string>
                <key>CriticalAlertEnabled</key>
                <true/>
                <key>NotificationsEnabled</key>
                <true/>
                <key>ShowInLockScreen</key>
                <true/>
                <key>ShowInNotificationCenter</key>
                <true/>
                <key>SoundsEnabled</key>
                <true/>
            </dict>
        </array>
    </dict>
</array>

Customization is Key

One of the script's biggest strengths is its adaptability. This gives you, the MDM admin, the power to tailor it perfectly to your organization's needs. Here are some ways you can customize the script:

By leveraging the script's customizability, you can create a reboot management system that perfectly complements your existing policies and user preferences.


Why Not Use Nudge for macOS?

While the script offers a custom script solution, you might be wondering about Nudge for macOS, a popular tool for encouraging Mac updates. Nudge is a great option, and it does boast some fantastic features. However, here's why a custom script might be the better fit for some organizations:

Nudge excels in functionality. However, being open-source software can raise a red flag for some enterprises. Many organizations have strict policies against using open-source tools or software hosted on public repositories. This can stem from security concerns or a desire for a more controlled environment.

A custom script, offers an alternative path. It provides the flexibility to tailor notifications, uptime thresholds, and even alert sounds to your organization's specific needs and policies. This level of customization isn't readily available with Nudge.

Both Nudge and custom scripts offer effective ways to manage Mac reboots. Ultimately, the best choice depends on your organization's unique requirements and security policies. If you prioritize a controlled environment and need complete customization, custom scripts might be the perfect solution for you!


Conclusion

There you have it! I hope this post offers a powerful and versatile solution for automated Mac reboots in your enterprise. It streamlines your workflow, empowers users with control, and ensures optimal system health โ€“ all while freeing you up for more strategic tasks.

So ditch the manual click-a-thon and embrace the future of automated Mac reboots! Make your life easier and your Macs happier (and faster!).

๐Ÿ’ก
The script can be downloaded from:
macOS/Shell Scripts/schedule_reboot.sh at main ยท pathaksomesh06/macOS
macOS. Contribute to pathaksomesh06/macOS development by creating an account on GitHub.

Share This Post

Check out these related posts

Early Bird Gets the Worm: Testing iOS 18 & macOS 15 (Beta) Devices with Intune

Platform SSO for macOS: A Deep Dive into Configuration & Troubleshooting

Application Inventory: The Unsung Hero of macOS Security