Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:19:50+00:00 2026-05-26T18:19:50+00:00

I have the below code that does various things and checks hotfix info. I

  • 0

I have the below code that does various things and checks hotfix info. I tried on Windows Server 2008 SP2 servers and they do not have Powershell v2 installed. So, instead of going through my estate and fixing this for the moment (there are 3000+ 2008 SP2 servers) – I need to change my code.

I know Win32_quickfixengineering can do the same thing but not too sure what i should change in my code – any help please:

$computerdel = gc env:computername

$t = "C:\buildlog\$(gc env:computername).log"
#$e = Test-Path $t
rm $t -ErrorAction SilentlyContinue

#if ( $e -eq $true ) { rm $t }
#else { Write-Host "Shortcut does not exist." }


$Logfile = "C:\buildlog\$(gc env:computername).log"

Function LogWrite
{
   Param ([string]$logstring)

   Add-content $Logfile -value $logstring
}

LogWrite -----------------------------------------------------------------------------------------------------------------------------------------------

$computer = gc env:computername
$Date = Get-Date
$ExecutionpolicySET = Set-ExecutionPolicy Unrestricted
$OSVersion = Get-WmiObject Win32_operatingsystem

LogWrite "Script has been run on $Date - This is Servers Local Time"
LogWrite $computer
LogWrite "Server type: "
LogWrite $OSVersion.name

$onetcp = ((get-childitem c:\windows\system32\drivers\tcpip.sys).Versioninfo.ProductMajorPart).tostring()
$twotcp = ((get-childitem c:\windows\system32\drivers\tcpip.sys).Versioninfo.ProductMinorPart).tostring() 
$threetcp = ((get-childitem c:\windows\system32\drivers\tcpip.sys).Versioninfo.ProductBuildPart).tostring() 
$fourtcp = ((get-childitem c:\windows\system32\drivers\tcpip.sys).Versioninfo.ProductPrivatePart).tostring() 

$onedfsr = ((get-childitem c:\windows\system32\dfsrs.exe).Versioninfo.ProductMajorPart).tostring() 
$twodfsr = ((get-childitem c:\windows\system32\dfsrs.exe).Versioninfo.ProductMinorPart).tostring() 
$threedfsr = ((get-childitem c:\windows\system32\dfsrs.exe).Versioninfo.ProductBuildPart).tostring() 
$fourdfsr = ((get-childitem c:\windows\system32\dfsrs.exe).Versioninfo.ProductPrivatePart).tostring()

$hotfix1 = Get-HotFix -Id KB2450944 -ErrorAction SilentlyContinue 
$hotfix2 = Get-HotFix -Id KB2582284 -ErrorAction SilentlyContinue
$hotfix3 = Get-HotFix -Id KB979808 -ErrorAction SilentlyContinue
$hotfix4 = Get-HotFix -Id KB2121690 -ErrorAction SilentlyContinue
$hotfix5 = Get-HotFix -Id KB973776 -ErrorAction SilentlyContinue
$hotfix6 = Get-HotFix -Id KB953325 -ErrorAction SilentlyContinue
$hotfix7 = Get-HotFix -Id KB977357 -ErrorAction SilentlyContinue
$hotfix8 = Get-HotFix -Id KB2505348 -ErrorAction SilentlyContinue
$hotfix9 = Get-HotFix -Id KB2285835 -ErrorAction SilentlyContinue
$hotfix10 = Get-HotFix -Id KB976655 -ErrorAction SilentlyContinue
$hotfix11 = Get-HotFix -Id KB979564 -ErrorAction SilentlyContinue
$hotfix12 = Get-HotFix -Id KB962969 -ErrorAction SilentlyContinue

LogWrite

    If ($hotfix1) {
        LogWrite "Hotfix KB2450944 is installed - This is DFSRS.exe Upgrade Hotfix" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB2450944 is NOT installed - Please ensure you install this hotfix - This is DFSRS.exe Upgrade Hotfix" -ForegroundColor "red"
    }
    LogWrite "DFSRS.exe Version on $computer is: ""$onedfsr.$twodfsr.$threedfsr.$fourdfsr"" "

LogWrite

    If ($hotfix4) {
        LogWrite "Hotfix KB2121690 is installed - This is 20 CPU Patch" -BackgroundColor Green -ForegroundColor Black
    }
    else {
    LogWrite "Hotfix KB2121690 is NOT installed - This is 20 CPU Patch" -ForegroundColor "red"
}

LogWrite

If ($OSVersion.version -eq "6.0.6002") 
{
    If ($hotfix5) {
        LogWrite "Hotfix KB973776 is installed - This is Robocopy Upgrade Hotfix" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB973776 is NOT installed - This is Robocopy Upgrade Hotfix" -ForegroundColor "red"
    }

    If ($hotfix6) {
        LogWrite "Hotfix KB953325 is installed - Resolves Paged Pool Exhusion Issue" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB953325 is NOT installed - Resolves Paged Pool Exhusion Issue" -ForegroundColor "red"
    }
    If ($hotfix12) {
        LogWrite "Hotfix KB962969 is installed - Resolves Command Line error on DFSRadmin.exe" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB962969 is NOT installed - Resolves Command Line error on DFSRadmin.exe" -ForegroundColor "red"
    }

}

ElseIf ($OSVersion.version -eq "6.1.7600")
{

    If ($hotfix2) {
        LogWrite "Hotfix KB2582284 is installed - This is TCPIP.sys Upgrade Hotfix" -BackgroundColor Green -ForegroundColor Black
        }
    else {
        LogWrite "Hotfix KB2582284 is NOT installed - Please ensure you install this hotfix - This is DFSRS.exe Upgrade Hotfix" -ForegroundColor "red"
        }

    LogWrite "TCPIP.sys Version on $computer is: ""$onetcp.$twotcp.$threetcp.$fourtcp"" "

LogWrite

    If ($hotfix3) {
        LogWrite "Hotfix KB979808 is installed - This is Robocopy R2 Pre-Seeding Upgrade" -BackgroundColor Green -ForegroundColor Black
        }
    else {
        LogWrite "Hotfix KB979808 is NOT installed - This is Robocopy R2 Pre-Seeding Upgrade" -ForegroundColor "red"
    }
LogWrite
    If ($hotfix7) {
        LogWrite "Hotfix KB977357 is installed - Resolves Memory Leak on WMI" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB977357 is NOT installed - Resolves Memory Leak on WMI" -ForegroundColor "red"
    }
LogWrite
    If ($hotfix8) {
        LogWrite "Hotfix KB2505348 is installed - Resolves Performance issues on WMI" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB2505348 is NOT installed - Resolves Performance issues on WMI" -ForegroundColor "red"
    }
LogWrite
If ($hotfix10) {
        LogWrite "Hotfix KB976655 is installed - Update for dfsro.dll" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB976655 is NOT installed - Update for dfsro.dll" -ForegroundColor "red"
    }
LogWrite
If ($hotfix11) {
        LogWrite "Hotfix KB979564 is installed - Dfsrclus.dll update" -BackgroundColor Green -ForegroundColor Black
    }
    else {
        LogWrite "Hotfix KB979564 is NOT installed - Dfsrclus.dll update" -ForegroundColor "red"
    }


LogWrite -----------------------------------------------------------------------------------------------------------------------------------------------
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:19:51+00:00Added an answer on May 26, 2026 at 6:19 pm

    The Get-Hotfix cmdlet when invoked with the -Id parameter runs a wmi query for each id in that parameter with that id in the where clause of the wmi query.

    The Get-Hotfix cmdlet will throw an error when no hotfixes that match your criteria can be found. To suppress the error message you can add -ErrorAction SilentlyContinue

    When running a wmi query using Get-WmiObject -query no error is thrown if no objects can be found matching the criteria in the query.

    This means that the following two statements are equivalent (the second one will also work on Powershell v1):

    Get-HotFix -Id KB2450944 -ErrorAction SilentlyContinue
    Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB2450944'"
    

    In your code you should replace this block of code:

    $hotfix1 = Get-HotFix -Id KB2450944 -ErrorAction SilentlyContinue 
    $hotfix2 = Get-HotFix -Id KB2582284 -ErrorAction SilentlyContinue
    $hotfix3 = Get-HotFix -Id KB979808 -ErrorAction SilentlyContinue
    $hotfix4 = Get-HotFix -Id KB2121690 -ErrorAction SilentlyContinue
    $hotfix5 = Get-HotFix -Id KB973776 -ErrorAction SilentlyContinue
    $hotfix6 = Get-HotFix -Id KB953325 -ErrorAction SilentlyContinue
    $hotfix7 = Get-HotFix -Id KB977357 -ErrorAction SilentlyContinue
    $hotfix8 = Get-HotFix -Id KB2505348 -ErrorAction SilentlyContinue
    $hotfix9 = Get-HotFix -Id KB2285835 -ErrorAction SilentlyContinue
    $hotfix10 = Get-HotFix -Id KB976655 -ErrorAction SilentlyContinue
    $hotfix11 = Get-HotFix -Id KB979564 -ErrorAction SilentlyContinue
    $hotfix12 = Get-HotFix -Id KB962969 -ErrorAction SilentlyContinue
    

    with this block of code:

    $hotfix1 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB2450944'" 
    $hotfix2 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB2582284'"
    $hotfix3 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB979808'"
    $hotfix4 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB2121690'"
    $hotfix5 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB973776'"
    $hotfix6 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB953325'"
    $hotfix7 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB977357'"
    $hotfix8 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB2505348'"
    $hotfix9 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB2285835'"
    $hotfix10 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB976655'"
    $hotfix11 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB979564'"
    $hotfix12 = Get-WmiObject -Query "Select * from Win32_QuickFixEngineering where HotFixID= 'KB962969'"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the below code that does not seem to work at all :(
does anyone knows what's wrong with the below code that I have? I just
I have the code below that hides and shows the navigational bar. It is
I have this javascript code below that uses jquery, it is suppoed to be
below i have a code that runs in most of my simple programs ..
Background: I have a WPF UserControl (MainControl - not shown in code below) that
I have a plot (sample code pasted below) that I am trying to add
The code below works great. I have a MySQL database that contains book titles
I have a data that looks like this . And my code below simply
I have written a very simple WCF service, that worked fine (code below), then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.