PowerShell for the Windows Update for Business deployment service

Published Jun 10 2021 03:52 PM 13.2K Views
Microsoft

Starting today, you can use PowerShell in tandem with Microsoft Graph APIs to utilize the Windows Update for Business deployment service. In case you aren't yet familiar with it, the Windows Update for Business deployment service provides cloud-based control over the approval, scheduling, and safeguarding of content delivered from Windows Update—enabling you to meet your organization's update and compliance goals no matter where your devices are on the planet.

In addition to Microsoft Graph APIs (currently in public preview), you can also use the Microsoft Graph PowerShell SDK to explore the latest functionality of the deployment service and quickly script and automate common update actions. It provides a simple way to get total control over how updates are deployed to your organization.

Now let's dive into a concrete example to demonstrate how you can leverage deployment service capabilities through PowerShell.

Walkthrough: How to deploy an expedited quality update

Let's say that Microsoft releases an update addressing a a high-priority security vulnerability or a quality fix for a critical line of business application that is crucial for your organization. In this case, you may want to deploy this update faster than your default update ring configuration. With PowerShell and the Windows Update for Business deployment service, you can deploy an expedited update, which overrides your default steady-state update settings and deploys the latest available updates so that your managed devices meet the minimum required Windows revision as quickly as possible.

Prerequisites

Before getting started, the following prerequisites must be met:

Assigning user roles for delegated permissions in PowerShell

Once you have confirmed that your tenant and devices meet the deployment service prerequisites, ensure your user account has one of the following permissions configured:

  • Global Admin Role in Azure Active Directory
  • Intune Admin Role in Azure Active Directory
  • Policy and Profile Manager Role in Microsoft Intune
  • Windows Update Deployment Administrator in Azure Active Directory

At least one of these roles is required for a user to be authorized to interact with the deployment service. To learn more, see Assign Azure AD roles to users and Assign a role to an Intune user.

Getting started with the Microsoft Graph PowerShell SDK

If you don’t already use PowerShell, your next step is to install a supported version of PowerShell. To learn how, see install PowerShell for your operating system.

Once you’ve installed PowerShell, ensure that you are running the latest version of the Microsoft Graph PowerShell SDK to be able to use the deployment service’s commands. You can install the SDK in PowerShell Core or Windows PowerShell using the following command:

 

 

Install-Module Microsoft.Graph

 

 

If you have already installed the Microsoft Graph PowerShell SDK, you can update the SDK and its dependencies using the following command. You must use version 1.6.0 or higher to use the deployment service:

 

 

Update-Module Microsoft.Graph

 

 

From this point on, every command will use the prefix Mg, which stands for Microsoft Graph. The deployment service is currently available through the beta endpoint of the Microsoft Graph, so you’ll need to set your user profile to the appropriate API contract.

 

 

Select-MgProfile -Name "beta"

 

 

Finally, use the Connect-MgGraph command to sign in. You'll need to sign in with an account assigned to one of the required roles to consent to the permissions specified under scopes in this command.

 

 

Connect-MgGraph -Scopes "WindowsUpdates.ReadWrite.All"

 

 

01_powershell-deployment-service.png
02_powershell-deployment-service.png

Once the Graph PowerShell SDK is installed and you are signed in, you’re ready to start scripting common actions in the deployment service.

If you’re using an automated script instead of the PowerShell console, you can use the PSCredential Class to automate usernames, passwords, and credentials. 

Step 1: Get a list of available updates

With expedited updates, you can speed the installation of quality updates like the most recent Update Tuesday release or an out-of-band security update for a zero-day flaw. An expedited deployment policy enables your devices below the minimum specified revision to override their default update posture and update as quickly as possible to the latest available update.

Let’s start by querying the deployment service catalog to get a list of security updates that can be specified as the minimum compliance bar for an expedited update. Below is an example of a query to the catalog that shows the quality updates available to expedite from most recent to last.  

 

 

Get-MgWindowsUpdatesCatalogEntry -Filter "microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/isExpeditable eq true"

 

 

The output of the query will look something like this:

03_powershell-deployment-service.png

Step 2: Create a deployment

Now we’ll create an expedited deployment. The content to deploy is specified using the releaseDate key (which specifies a compliance floor), and the device restart grace period is determined using the daysUntilForcedReboot property. Below is an example of creating a deployment for an expedited quality update.  

 

 

New-MgWindowsUpdatesDeployment -Content @{"@odata.type" = "microsoft.graph.windowsUpdates.expeditedQualityUpdatereference"; "releaseDate" = "2021-05-11"}

 

 

When the command successfully creates a deployment, it outputs something along the lines of the following:

04_powershell-deployment-service.png

Step 3: Assign devices to the deployment audience

Finally, let’s assign devices to the expedited deployment just created. Devices can be assigned directly or via an updatable asset group. Below is an example of adding an Azure AD device to a deployment using its ID. The DeploymentID comes from the response of the previous command.

 

 

Update-MgWindowsUpdatesDeploymentAudience -DeploymentID "a257062d-b716-43b9-99339-d13ea06eeeec" -AddMembers @(@{"id" = "dae37284-9dae-453a-aa61-dee371139090"; "@odata.type" = "Microsoft.graph.WindowsUpdates.azureADDevice"}) 

 

 

There’s no output from this command. Once you have assigned devices to the deployment audience, the deployment service will begin expediting updates as quickly as possible! You’ll be able to check the status of each device as your deployment progresses using Update Compliance.

Wrapping up

We hope that this example provides you with a practical tool for managing and responding to situations that require rapid deployment of quality updates while illustrating how you can use PowerShell to interact with the deployment service more generally. We encourage you to expedite an update within your organization and explore the broader set of capabilities available within the deployment service. Stay tuned for more examples!

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2437208%22%20slang%3D%22en-US%22%3EPowerShell%20for%20the%20Windows%20Update%20for%20Business%20deployment%20service%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2437208%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EStarting%20today%2C%20you%20can%20use%20PowerShell%20in%20tandem%20with%20Microsoft%20Graph%20APIs%20to%20utilize%20the%20Windows%20Update%20for%20Business%20deployment%20service.%20In%20case%20you%20aren't%20yet%20familiar%20with%20it%2C%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-it-pro-blog%2Fannouncing-the-windows-update-for-business-deployment-service%2Fba-p%2F2178419%22%20target%3D%22_blank%22%3EWindows%20Update%20for%20Business%20deployment%20service%3C%2FA%3E%20provides%20cloud-based%20control%20over%20the%20approval%2C%20scheduling%2C%20and%20safeguarding%20of%20content%20delivered%20from%20Windows%20Update%E2%80%94enabling%20you%20to%20meet%20your%20organization's%20update%20and%20compliance%20goals%20no%20matter%20where%20your%20devices%20are%20on%20the%20planet.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIn%20addition%20to%20Microsoft%20Graph%20APIs%20(currently%20in%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-it-pro-blog%2Fpublic-preview-of-microsoft-graph-apis-to-manage-windows-updates%2Fba-p%2F2302751%22%20target%3D%22_blank%22%3Epublic%20preview%3C%2FA%3E)%2C%20you%20can%20also%20use%20the%20Microsoft%20Graph%20PowerShell%20SDK%20to%20explore%20the%20latest%20functionality%20of%20the%20deployment%20service%20and%20quickly%20script%20and%20automate%20common%20update%20actions.%20It%20provides%20a%20simple%20way%20to%20get%20total%20control%20over%20how%20updates%20are%20deployed%20to%20your%20organization.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ENow%20let's%20dive%20into%20a%20concrete%20example%20to%20demonstrate%20how%20you%20can%20leverage%20deployment%20service%20capabilities%20through%20PowerShell.%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--440094098%22%20id%3D%22toc-hId--440094104%22%3EWalkthrough%3A%20How%20to%20deploy%20an%20expedited%20quality%20update%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ELet's%20say%20that%20Microsoft%20releases%20an%20update%20addressing%20a%20a%20high-priority%20security%20vulnerability%20or%20a%20quality%20fix%20for%20a%20critical%20line%20of%20business%20application%20that%20is%20crucial%20for%20your%20organization.%20In%20this%20case%2C%20you%20may%20want%20to%20deploy%20this%20update%20faster%20than%20your%20default%20update%20ring%20configuration.%20With%20PowerShell%20and%20the%20Windows%20Update%20for%20Business%20deployment%20service%2C%20you%20can%20deploy%20an%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fgraph%2Fwindowsupdates-deploy-expedited-update%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eexpedited%20update%3C%2FA%3E%2C%20which%20overrides%20your%20default%20steady-state%20update%20settings%20and%20deploys%20the%20latest%20available%20updates%20so%20that%20your%20managed%20devices%20meet%20the%20minimum%20required%20Windows%20revision%20as%20quickly%20as%20possible.%3C%2FP%3E%0A%3CH3%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2017px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-250467376%22%20id%3D%22toc-hId-250467370%22%3EPrerequisites%3C%2FH3%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EBefore%20getting%20started%2C%20the%20following%20prerequisites%20must%20be%20met%3A%3C%2FP%3E%0A%3CUL%20style%3D%22font-size%3A%2014px%3B%22%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%20margin-top%3A%2020px%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fgraph%2Fwindowsupdates-concept-overview%23prerequisites%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ESubscription%20service%20and%20device%20prerequisites%3C%2FA%3E%20for%20the%20Windows%20Update%20for%20Windows%20Update%20for%20Business%20deployment%20service%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3EDevices%20have%20installed%20the%20update%20described%20in%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Ftopic%2Fkb4023057-update-for-windows-10-update-service-components-fccad0ca-dc10-2e46-9ed1-7e392450fb3a%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EKB4023057%20-%20Update%20for%20Windows%2010%20Update%20Service%20components%3C%2FA%3E%26nbsp%3B(or%20newer)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2017px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--1556987087%22%20id%3D%22toc-hId--1556987093%22%3EAssigning%20user%20roles%20for%20delegated%20permissions%20in%20PowerShell%3C%2FH3%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EOnce%20you%20have%20confirmed%20that%20your%20tenant%20and%20devices%20meet%20the%20deployment%20service%20prerequisites%2C%20ensure%20your%20user%20account%20has%20one%20of%20the%20following%20permissions%20configured%3A%3C%2FP%3E%0A%3CUL%20style%3D%22font-size%3A%2014px%3B%22%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%20margin-top%3A%2020px%3B%22%3EGlobal%20Admin%20Role%20in%20Azure%20Active%20Directory%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3EIntune%20Admin%20Role%20in%20Azure%20Active%20Directory%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3EPolicy%20and%20Profile%20Manager%20Role%20in%20Microsoft%20Intune%3C%2FLI%3E%0A%3CLI%20style%3D%22margin-bottom%3A%208px%3B%22%3EWindows%20Update%20Deployment%20Administrator%20in%20Azure%20Active%20Directory%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EAt%20least%20one%20of%20these%20roles%20is%20required%20for%20a%20user%20to%20be%20authorized%20to%20interact%20with%20the%20deployment%20service.%20To%20learn%20more%2C%20see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Factive-directory%2Froles%2Fmanage-roles-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAssign%20Azure%20AD%20roles%20to%20users%20%3C%2FA%3Eand%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmem%2Fintune%2Ffundamentals%2Fassign-role%23%3A~%3Atext%3D%2520Assign%2520a%2520role%2520to%2520an%2520Intune%2520user%2CAssignment%2520description%252C%2520and%2520then%2520choose%2520Next.%2520More%2520%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAssign%20a%20role%20to%20an%20Intune%20user%3C%2FA%3E.%3C%2FP%3E%0A%3CH3%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2017px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-930525746%22%20id%3D%22toc-hId-930525740%22%3EGetting%20started%20with%20the%20Microsoft%20Graph%20PowerShell%20SDK%3C%2FH3%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIf%20you%20don%E2%80%99t%20already%20use%20PowerShell%2C%20your%20next%20step%20is%20to%20install%20a%20supported%20version%20of%20PowerShell.%20To%20learn%20how%2C%20see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fpowershell%2Fscripting%2Finstall%2Finstalling-powershell%3Fview%3Dpowershell-7.1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Einstall%20Powe%3C%2FA%3ErShell%20for%20your%20operating%20system.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EOnce%20you%E2%80%99ve%20installed%20PowerShell%2C%20ensure%20that%20you%20are%20running%20the%20latest%20version%20of%20the%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fgraph%2Fpowershell%2Finstallation%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%20Microsoft%20Graph%20PowerShell%20SDK%3C%2FA%3E%20to%20be%20able%20to%20use%20the%20deployment%20service%E2%80%99s%20commands.%20You%20can%20install%20the%20SDK%20in%20PowerShell%20Core%20or%20Windows%20PowerShell%20using%20the%20following%20command%3A%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EInstall-Module%20Microsoft.Graph%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIf%20you%20have%20already%20installed%20the%20Microsoft%20Graph%20PowerShell%20SDK%2C%20you%20can%20update%20the%20SDK%20and%20its%20dependencies%20using%20the%20following%20command.%20You%20must%20use%20version%201.6.0%20or%20higher%20to%20use%20the%20deployment%20service%3A%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EUpdate-Module%20Microsoft.Graph%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EFrom%20this%20point%20on%2C%20every%20command%20will%20use%20the%20prefix%20%3CSTRONG%3EMg%3C%2FSTRONG%3E%2C%20which%20stands%20for%20Microsoft%20Graph.%20The%20deployment%20service%20is%20currently%20available%20through%20the%20beta%20endpoint%20of%20the%20Microsoft%20Graph%2C%20so%20you%E2%80%99ll%20need%20to%20set%20your%20user%20profile%20to%20the%20appropriate%20API%20contract.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3ESelect-MgProfile%20-Name%20%22beta%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EFinally%2C%20use%20the%20Connect-MgGraph%20command%20to%20sign%20in.%20You'll%20need%20to%20sign%20in%20with%20an%20account%20assigned%20to%20one%20of%20the%20required%20roles%20to%20consent%20to%20the%20permissions%20specified%20under%20scopes%20in%20this%20command.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EConnect-MgGraph%20-Scopes%20%22WindowsUpdates.ReadWrite.All%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2201_powershell-deployment-service.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F287954iBF53808DD7301526%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2201_powershell-deployment-service.png%22%20alt%3D%2201_powershell-deployment-service.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2202_powershell-deployment-service.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F287955i3AA7BD39C0D243CD%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2202_powershell-deployment-service.png%22%20alt%3D%2202_powershell-deployment-service.png%22%20%2F%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3EOnce%20the%20Graph%20PowerShell%20SDK%20is%20installed%20and%20you%20are%20signed%20in%2C%20you%E2%80%99re%20ready%20to%20start%20scripting%20common%20actions%20in%20the%20deployment%20service.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EIf%20you%E2%80%99re%20using%20an%20automated%20script%20instead%20of%20the%20PowerShell%20console%2C%20you%20can%20use%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fdotnet%2Fapi%2Fsystem.management.automation.pscredential%3Fview%3Dpowershellsdk-7.0.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EPSCredential%20Class%3C%2FA%3E%20to%20automate%20usernames%2C%20passwords%2C%20and%20credentials.%26nbsp%3B%3C%2FP%3E%0A%3CH3%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2017px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--876928717%22%20id%3D%22toc-hId--876928723%22%3EStep%201%3A%20Get%20a%20list%20of%20available%20updates%3C%2FH3%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EWith%20expedited%20updates%2C%20you%20can%20speed%20the%20installation%20of%20quality%20updates%20like%20the%20most%20recent%26nbsp%3BUpdate%20Tuesday%26nbsp%3Brelease%20or%20an%20out-of-band%20security%20update%20for%20a%20zero-day%20flaw%3CEM%3E.%3C%2FEM%3E%20An%20expedited%20deployment%20policy%20enables%20your%20devices%20below%20the%20minimum%20specified%20revision%20to%20override%20their%20default%20update%20posture%20and%20update%20as%20quickly%20as%20possible%20to%20the%20latest%20available%20update.%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ELet%E2%80%99s%20start%20by%20querying%20the%20deployment%20service%20catalog%20to%20get%20a%20list%20of%20security%20updates%20that%20can%20be%20specified%20as%20the%20minimum%20compliance%20bar%20for%20an%20expedited%20update.%20Below%20is%20an%20example%20of%20a%20query%20to%20the%20catalog%20that%20shows%20the%20quality%20updates%20available%20to%20expedite%20from%20most%20recent%20to%20last.%20%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EGet-MgWindowsUpdatesCatalogEntry%20-Filter%20%22microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry%2FisExpeditable%20eq%20true%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EThe%20output%20of%20the%20query%20will%20look%20something%20like%20this%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2203_powershell-deployment-service.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F287953iD427FCD09504DCCF%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2203_powershell-deployment-service.png%22%20alt%3D%2203_powershell-deployment-service.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2017px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId-1610584116%22%20id%3D%22toc-hId-1610584110%22%3EStep%202%3A%20Create%20a%20deployment%3C%2FH3%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3ENow%20we%E2%80%99ll%20create%20an%20expedited%20deployment.%20The%20content%20to%20deploy%20is%20specified%20using%20the%20%3CSTRONG%3EreleaseDate%3C%2FSTRONG%3E%20key%20(which%20specifies%20a%20compliance%20floor)%2C%20and%20the%20device%20restart%20grace%20period%20is%20determined%20using%20the%20%3CSTRONG%3EdaysUntilForcedReboot%3C%2FSTRONG%3E%20property.%20Below%20is%20an%20example%20of%20creating%20a%20deployment%20for%20an%20expedited%20quality%20update.%20%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3ENew-MgWindowsUpdatesDeployment%20-Content%20%40%7B%22%40odata.type%22%20%3D%20%22microsoft.graph.windowsUpdates.expeditedQualityUpdatereference%22%3B%20%22releaseDate%22%20%3D%20%222021-05-11%22%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EWhen%20the%20command%20successfully%20creates%20a%20deployment%2C%20it%20outputs%20something%20along%20the%20lines%20of%20the%20following%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2204_powershell-deployment-service.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F287951i2EEA3C0A5BCE099E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%2204_powershell-deployment-service.png%22%20alt%3D%2204_powershell-deployment-service.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2017px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--196870347%22%20id%3D%22toc-hId--196870353%22%3EStep%203%3A%20Assign%20devices%20to%20the%20deployment%20audience%3C%2FH3%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EFinally%2C%20let%E2%80%99s%20assign%20devices%20to%20the%20expedited%20deployment%20just%20created.%20Devices%20can%20be%20assigned%20directly%20or%20via%20an%20updatable%20asset%20group.%20Below%20is%20an%20example%20of%20adding%20an%20Azure%20AD%20device%20to%20a%20deployment%20using%20its%20ID.%20The%20DeploymentID%20comes%20from%20the%20response%20of%20the%20previous%20command.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EUpdate-MgWindowsUpdatesDeploymentAudience%20-DeploymentID%20%22a257062d-b716-43b9-99339-d13ea06eeeec%22%20-AddMembers%20%40(%40%7B%22id%22%20%3D%20%22dae37284-9dae-453a-aa61-dee371139090%22%3B%20%22%40odata.type%22%20%3D%20%22Microsoft.graph.WindowsUpdates.azureADDevice%22%7D)%26nbsp%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EThere%E2%80%99s%20no%20output%20from%20this%20command.%20Once%20you%20have%20assigned%20devices%20to%20the%20deployment%20audience%2C%20the%20deployment%20service%20will%20begin%20expediting%20updates%20as%20quickly%20as%20possible!%20You%E2%80%99ll%20be%20able%20to%20check%20the%20status%20of%20each%20device%20as%20your%20deployment%20progresses%20using%20Update%20Compliance.%3C%2FP%3E%0A%3CH2%20style%3D%22margin-top%3A%2036px%3B%20margin-bottom%3A%2020px%3B%20font-family%3A%20'Segoe%20UI'%2C%20Segoe%2C%20Tahoma%2C%20Geneva%2C%20sans-serif%3B%20font-weight%3A%20600%3B%20font-size%3A%2020px%3B%20color%3A%20%23333333%3B%22%20id%3D%22toc-hId--207373451%22%20id%3D%22toc-hId--207373457%22%3EWrapping%20up%3C%2FH2%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3EWe%20hope%20that%20this%20example%20provides%20you%20with%20a%20practical%20tool%20for%20managing%20and%20responding%20to%20situations%20that%20require%20rapid%20deployment%20of%20quality%20updates%20while%20illustrating%20how%20you%20can%20use%20PowerShell%20to%20interact%20with%20the%20deployment%20service%20more%20generally.%20We%20encourage%20you%20to%20expedite%20an%20update%20within%20your%20organization%20and%20explore%20the%20broader%20set%20of%20capabilities%20available%20within%20the%20deployment%20service.%20Stay%20tuned%20for%20more%20examples!%3C%2FP%3E%0A%3CP%20style%3D%22margin-top%3A%2020px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2437208%22%20slang%3D%22en-US%22%3E%3CP%3ELearn%20how%20to%20use%26nbsp%3BPowerShell%20to%20deploy%20an%20expedited%20quality%20update%20to%20the%20Windows%2010%20devices%20in%20your%20organization.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2437208%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EServicing%20and%20updates%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Jul 27 2021 02:17 PM
Updated by: