top of page

💻 PowerShell Script to Check Microsoft Security Updates (KB) Across Multiple Computers

Published on: August 14, 2025

Author: Avijit Dutta

Category: PowerShell Scripting | Microsoft | IT Infrastructure Administration


PowerShell Script: Check Microsoft Security Updates (KB) Across Multiple Computers

🚀 Introduction - PowerShell Script to Check Microsoft Security Updates (KB) Across Multiple Computers


Keeping Windows systems up-to-date with the latest Microsoft Security Updates 🔒 is crucial for maintaining security and compliance ✅. Manually checking each system for a specific KB (Knowledge Base) update 📚 can be time-consuming — especially in large environments with multiple computers or servers 🖥️🖥️.


In this post, you’ll learn how to use a PowerShell Script to Check Microsoft Security Updates (KB) Across Multiple Computers⚡. We’ll read KB numbers 📄 and computer names 💻 from text files, check each system, and export a detailed report 📊 showing which updates are installed ✅ and which are missing ❌.



🛠️ Prerequisites


Before running the script, make sure you have:


  1. 🖥️ PowerShell 5.1 or later (Windows 10/11 & Server 2012+).

  2. 🔑 Administrative access to target computers.

  3. 🔄 Remote PowerShell execution enabled (Enable-PSRemoting).

  4. 📂 Two text files:

    • C:\security_update\securityupdate.txt → contains KB numbers (one per line).

    • C:\security_update\computers.txt → contains computer names (one per line).

📄 securityupdate.txt file should be look like


📄 computers.txt file should be look like


🔍 How the Script Works


  1. 📥 Reads KB numbers from securityupdate.txt.

  2. 📥 Reads computer names from computers.txt.

  3. 🛠️ Uses PowerShell’s Get-HotFix to check each machine for each KB.

  4. ✅ If found → logs Installed Date.

  5. ❌ If not found → marks "Not Installed".

  6. 📤 Exports results to a CSV report.


Flowchart Diagram showing the KB checking process

flowchart diagram showing the KB checking process

💾 The Complete PowerShell Script



📥 Download the Script


The full script named "Check-KBStatus.ps1" is included in the zip file "Check-KBStatus.zip". You can download it, unzip it, and use it.


📊 Sample Output

💻 ComputerName

🔢 KBNumber

📅 InstalledDate

📌 Status

PC-IT-01

KB5028166

08-08-2025

Installed ✅

PC-IT-01

KB5030213


Not Installed ❌

PC-IT-02

KB5028166

05-08-2025

Installed ✅

PC-IT-02

KB5030213


Not Installed ❌


✅ Conclusion


By using this PowerShell automation ⚡, you can save hours ⏳ of manual work while ensuring all systems are patched 🔒.This script is scalable, efficient, and easy to maintain 🛠️ — a must-have for IT admins managing multiple machines 🖥️.

💡 Pro Tip: Schedule this script via Task Scheduler 📅 to run automatically and email you 📧 the results for seamless patch compliance tracking.


☕ Found this helpful? Share it & show some love!

Your small support helps fuel more free, volunteer-driven content like this. Thank you! 🙏

Komentari


bottom of page