search
Categories
Archive
Blogroll

Badges

Microsoft PowerShell MVP
MCSE
Sponsors

VirtualMetric
Cozumpark Bilisim Portali
Comparing Hotfixes and Windows Updates to find missing ones on your Microsoft Cluster
Posted in Windows Powershell, Windows Server | No Comment | 690 views | 17/09/2013 17:32

This is very useful script to get missing updates from your cluster nodes. Just run this on one of your Cluster node. Make sure you run PowerShell as (Domain) Administrator. Otherwise you can’t query your Cluster.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Yusuf Ozturk, 2013
# http://www.yusufozturk.info
 
# Lets get our master Cluster Node, thats one of the most updated Cluster Node
$MasterNode = ((Get-Cluster | Get-ClusterNode | Select Name,@{label="HotFixes";expression={(Get-Hotfix -ComputerName $_.Name).HotFixID.Count}} | Sort HotFixes -Descending)[0]).Name
 
# Get Master Hotfix KBs and put them in a array
$MasterHotfixes = @((Get-Hotfix -ComputerName $MasterNode).HotFixID)
 
# Now we will use that master hotfixes to compare with others
$HotfixResults = (Get-Cluster | Get-ClusterNode | Select Name,@{label="Total Hotfixes";expression={(Get-Hotfix -ComputerName $_.Name).HotFixID.Count}},@{label="Missing Hotfixes";expression={$Hotfixes = @((Get-Hotfix -ComputerName $_.Name).HotFixID); $MissingHotfixes = (Compare-Object -ReferenceObject $MasterHotfixes -DifferenceObject $Hotfixes).InputObject; if ($MissingHotfixes) { $MissingHotfixes } else { $MissingHotfixes = "No missing updates"; $MissingHotfixes } }} | Sort Name)
 
# You can get hotfix IDs like this
$HotfixResults[0].'Missing Hotfixes'

You will see pretty nice output :)



Leave a Reply