I want to prepareing powershell script to update only critical security patch

Pradeep MISHRA 31 Reputation points
2020-06-09T14:36:29.557+00:00

Hi Support,

I have 4 subscription and more then 40 Azure VM and Linux VM and i want to search power shell script to update only window security critical patch.

I don't want to use azure update management

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,036 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Manu Philip 20,206 Reputation points MVP Volunteer Moderator
    2020-06-09T17:34:35.26+00:00

    Hello @PradeepMISHRA,

    You can prepare a PS script using the following cmdlets. This script is applicable to a single computer. But you can easily prepare it for all computers in the network

    Run the following commands in a computer and see how it works. By adding the required cmdlets for remote installation, you can automate it for entire computers.

     Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force
     Install-PackageProvider NuGet
     Install-Module PSWindowsUpdate
     Import-Module PSWindowsUpdate
    

    Now the computer is ready to check online for available updates.

     Get-WindowsUpdate
    

    The list will show you available updates. Select the required updates and update it using the following cmdlet

     Install-WindowsUpdate -KBArticleID <ID1> <ID2>...
    

    Please mark as "Accept the answer" if the above steps helps you. Others with similar issues can also follow the solution as per your suggestion

    Regards,

    Manu


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.