How Can I Automate Patching of Desktop Images?

How Can I Automate Patching of Desktop Images?

Occasionally, MSP admins manually install applications, or the app updates, on their dynamic hosts. When the hosts are re-imaged, those applications are lost, or the apps are reverted to their previous versions installed on the hosts’ underlying desktop image.

Nerdio Manager provides a method to ensure consistency for the app installation and updates on your desktop image(s). Specifically, it provides out-of-the-box scripts that you can run on your golden desktop image to automatically install Microsoft patches and updates. Running these scripts ensures that the Windows OS and some common applications, installed on your desktop image, are up to date, and you don’t lose any apps or updates when re-imaging your hosts.

Below are the out-of-the-box Windows scrips you might want to run:

  • Update Windows 11

  • Update Windows 10

  • Install Microsoft 365 Office Apps

  • Install Microsoft Teams

  • Install Microsoft Teams (New)

  • Install OneDrive Sync Per Machine

To automate your desktop image patching, complete the following steps:

Note: The entire process should take approximately two hours to complete, assuming you don't have many patches to install.

Step 1: Assign Windows Scripts to Customer Accounts

The out-of-the-box Windows scripts you need to run are stored at the global MSP level. To enable them for your customer accounts, you need to assign those scripts to all or individual accounts you manage.

Note: Alternatively, you can create a group of Windows scripts based on the function they perform, for example, install Microsoft patches and updates. You can then assign that group, rather than individual scripts, to your managed accounts. For details, see Overview of Scripted Actions Groups.

To assign Windows scripts to accounts:

  1. At the MSP level, navigate to Scripted actions > Windows scripts.

  2. From the action menu next to the script you want to assign, select Assign accounts.

    Tip: Use the Search field to quickly find the script you need.

  3. Select the accounts you need to assign the script to.

    • Select All to assign the script to all of your managed accounts.

  4. Select OK.

Step 2: Run Windows Scripts on a Desktop Image

Once you have assigned the Windows scripts to accounts, you can now run those scripts on the desktop image during the Set as image task.

To run Windows scripts on the desktop image:

  1. At the Account level, navigate to Desktop images.

  2. Locate the desktop image you wish to work with.

  3. From the action menu, select Set as image.

  4. Enable the Run the following scripted actions before set as image option, and then provide the following details:

    • Windows scripts: From the drop-down menu, select the scripts that you previously assigned to this account.

    • Target VM: Select Source. This option ensures that the changes made by the scripts are not overwritten during the future image maintenance or staging.

    • Error Handling: Enable this option, and then provide the following details:

      • Retry Threshold: Set this option to 1. This value defines the number of attempts to complete the Power off & set as image task before failing.

      • Cleanup after failure: Select this option, and then set Hours until cleanup on failure to 1.

        This option shuts down and removes the resources created during the Power off & set as image process after the Retry Threshold has been met.

    • Retain current image object (Optional): Select this option if you want to retain the existing image as a standalone object, rather than overwriting it with the new one.

    • Versions to keep: Select the number of image versions you want to keep.

    • If you want to use the AI Vision Boot Diagnostic Insights:

      • Validate image: Select this option to apply the image to a VM, gather boot diagnostics, and verify that the VM successfully boots before creating a managed image or publishing it to Azure Compute Gallery.

      • Use Boot Diagnostic Insights: Select this option to enable the Boot Diagnostic Insights.

        Important: If you want to use the Validation option, ensure Azure AI Boot Diagnostic Insights are enabled for each individual account. You can enable this option at the Account level, by navigating to Settings > Integrations > Azure AI. For details, see Overview of Boot Diagnostic Insights.

    • Change log: Enter a brief description of what should change once the Set as image task is completed.

    • Schedule: Enable the Schedule option to run the scripts during a selected time frame.

      Note: If the Schedule option is not enabled, the scripts start running as soon as you select OK.

      Provide the following details:

      • Start date: Select the date to start.

      • Time zone: From the drop-down list, select the time zone for the Start/End times.

      • Start time: From the drop-down lists, select the time to start. Day hours are recommended.

      • Repeat: From the drop-down list, select the recurring schedule, for example, Weekly (recommended).

      • Day of week: From the drop-down list, select the day of the week when the scripts should run, for example, Monday (recommended).

        Note:

        • Having the scripts run on Mondays on a weekly basis is recommended to prevent potential issues with faulty patches.

        • Running the scripts during the day, and having the notifications set up, helps you quickly take action if anything unexpected happens.

  5. Select OK.

Step 3: Configure Notifications

Once you have configured the Set as image task options, and defined the schedule to run Windows scripts, you now need to

define the condition and its corresponding action for Nerdio Manager to notify you if anything unexpected happens during the task.

To create a condition:

  1. At the MSP level, navigate to NotificationsConditions.

  2. In the Notification Conditions for Tasks section, select Add.

  3. Enter the following details:

    • Name: Type the name of the condition, such as Automated Patching of Desktop Images.

      Note: You need to specify this name when creating the corresponding notification action.

    • Accounts: By default, the Any option is defined. If you want to associate this condition with individual accounts, from the drop-down list, select the needed account(s).

    • Tasks: From the drop-down list, select the Power off & set as image and Schedule Power Off and Set as Image tasks.

    • Statuses: From the drop-down list, select the Error status that this condition should match.

      Note: Other fields that are not listed can remain as set by default.

  4. Select OK.

Once you have created the condition, you now need to create its corresponding action (sending out notifications) that should be triggered if the condition is met.

To create an action for the Error condition:

  1. At the MSP level, navigate to NotificationsActions.

  2. In the Notification actions section, select Add.

  3. Enter the following details:

    • Conditions: From the drop-down list, select the name of the condition you previously created.

    • Email notification: Select this option to send email notifications, and then provide the following details:

      • Send from: From the drop-down list, select a linked email address that is used to send the notification.

        Note: Only linked mailboxes are displayed. To link mailboxes, navigate to SettingsEnvironmentNotifications.

      • Send to: Type the email address(es) to send the notifications to.

        Note: Multiple emails can be specified separated by commas.

      • Include task detail: Select this option to include the task detail in the body of the email and attach it as a JSON file.

  4. Select OK.

Note: For more details about notifications, see Alerts and Notifications.

Was this article helpful?

0 out of 0 found this helpful
Have more questions? Submit a request

Comments (0 comments)

Article is closed for comments.