17 May 2010

System Center Configuration Manager 2007 Reviewers Guide

 

System Center Configuration Manager 2007 Reviewers Guide

 

http://mscoreinfra.members.winisp.net/SCCM2007/2008.02%20SCCM%20seminar/Unofficial%20SCCM%202007%20Reviewers%20Guide.pdf

System Center Configuration Manager 2007 Reviewers Guide

 

System Center Configuration Manager 2007 Reviewers Guide

 

http://mscoreinfra.members.winisp.net/SCCM2007/2008.02%20SCCM%20seminar/Unofficial%20SCCM%202007%20Reviewers%20Guide.pdf

Unable to load console on Primary Site Server

Symptom: Unable to load console on Primary Site Server

Further Conditions - WMI Failures indicated by errors 0x80041002 in the Event Log, MPControl.log.  Unable to connect to namespace root/cimv2.

Use the WMI Diag tool for further analaysis and confirmation of namespace errors.

Restart WMI service and check corresponding event log for errrors.

If necessary rebuild WMI using the WMIMGMT /salvagerepository command

Restart SCCM Services and check collections etc

Unable to load console on Primary Site Server

Symptom: Unable to load console on Primary Site Server

Further Conditions - WMI Failures indicated by errors 0x80041002 in the Event Log, MPControl.log.  Unable to connect to namespace root/cimv2.

Use the WMI Diag tool for further analaysis and confirmation of namespace errors.

Restart WMI service and check corresponding event log for errrors.

If necessary rebuild WMI using the WMIMGMT /salvagerepository command

Restart SCCM Services and check collections etc

Decommission or Deleting a Secondary Site from SCCM Console

Decommission or Deleting a Secondary Site from SCCM Console

1) Log on to the primary for the secondary site. Right click the secondary site and select delete
clip_image002

2) On the welcome page click next
clip_image004

3) Choose the option to delete or uninstall site
Delete this site

Select this option to delete the secondary site. Deleting a secondary site will delete all information about the site and its resources from the site database at its parent site, but it will leave the secondary site component files installed on the secondary site server computer.Important

When Configuration Manager 2007 sites are deleted, the deleted site information is only deleted from the deleted site's direct parent site. Site deletion information is not propagated up the hierarchy to grandparent sites. In order to delete the site from the site database at sites above the deleted site's direct parent site, the hierarchy maintenance tool (Preinst.exe) must be run on every primary site above the deleted site's parent primary site using the command Preinst /delsite. For more information about the hierarchy maintenance tool, see Hierarchy Maintenance Tool (Preinst.exe).

Uninstall this site

Select this option to uninstall the secondary site. Uninstalling a secondary site will uninstall the secondary site component from the secondary site server computer, and then delete all information about the site and its resources from the site database at its parent site.
clip_image006

Click finish to complete wizard.

Decommission or Deleting a Secondary Site from SCCM Console

Decommission or Deleting a Secondary Site from SCCM Console

1) Log on to the primary for the secondary site. Right click the secondary site and select delete
clip_image002

2) On the welcome page click next
clip_image004

3) Choose the option to delete or uninstall site
Delete this site

Select this option to delete the secondary site. Deleting a secondary site will delete all information about the site and its resources from the site database at its parent site, but it will leave the secondary site component files installed on the secondary site server computer.Important

When Configuration Manager 2007 sites are deleted, the deleted site information is only deleted from the deleted site's direct parent site. Site deletion information is not propagated up the hierarchy to grandparent sites. In order to delete the site from the site database at sites above the deleted site's direct parent site, the hierarchy maintenance tool (Preinst.exe) must be run on every primary site above the deleted site's parent primary site using the command Preinst /delsite. For more information about the hierarchy maintenance tool, see Hierarchy Maintenance Tool (Preinst.exe).

Uninstall this site

Select this option to uninstall the secondary site. Uninstalling a secondary site will uninstall the secondary site component from the secondary site server computer, and then delete all information about the site and its resources from the site database at its parent site.
clip_image006

Click finish to complete wizard.

Restore Procedure’s for Primary Sites

Restore Procedure’s for Primary Sites

1. To start the Site Repair Wizard from the Configuration Manager console:
Navigate to System Center Configuration Manager \ Site Database \ Site Management \ <site name>.

2. Right click <site name> and click Repair Site.

Note: The Site Repair Wizard can only be started from the Configuration Manager console installed on the site server to be repaired. The option to start the Site Repair Wizard is not available on remote Configuration Manager console installations.

Important: If the Local drives on site server and SQL Server destination option has been selected for the backup destination in the Backup ConfigMgr Site Server maintenance task, the site database backup files must be manually copied to the same location as the site data backup files before continuing.

3. On the Backup File Location page, click Browse to open the Browse for Folder dialog box, and browse to the location of the most recent site backup snapshot files (the backup destination specified in the Backup ConfigMgr Site Server maintenance task) and click OK to close the Browse for Folder dialog box.
Note: If the purpose of the site repair is to only recover lost site settings and the site database does not need to be restored, you can enable the Do not restore database option.

4. On the Progress page, review the steps the Site Repair Wizard takes to begin the repair process to ensure that they have completed successfully and click Next.

5. On the Parent Site Settings page, review the parent site settings to ensure that they have not changed since the site was last backed up.

6. On the Verify Site Hierarchy page, verify that the displayed site hierarchy information to be restored from backup is correct. If parent site, child site, or any site address information has changed since the last backup snapshot was created. You can view the site and site sender address properties information stored in the backup snapshot by clicking Properties. If child site was attached to, or detached from, the site to be recovered after the last backup snapshot was created, you can click Add to add the site to the repair information or Remove to remove the site from the site repair information. For new or deleted site sender addresses, you can click New or Delete in Addresses for selected site

7. (Optional). On the Reference Connection page, select a site that was active and accessible to the site to be recovered from the time the last backup snapshot was created and the time the Site Repair Wizard was started. The reference site will be used to recover any objects created at the primary site after the site was last backed up. For example, if a new collection was created at the site to be repaired after it was last backed up, the new collection can be recovered from the child reference site selected in Recover data from reference site.

8. On the Reference Site Data Recovery page, review the steps the Site Repair Wizard takes to recover reference site data to ensure they have completed successfully and click Next.

9. On the Object Pad page, specify and approximate number of Collections, Packages, and Advertisements that were created at this site since it was last backed up. This is to ensure that future collections, advertisements and collections created at the site after it is repaired do not contain duplicate IDs to those previously created. If there is non-zero data displayed in Collections, Packages, and Advertisements, it is based on the data recovered from the reference site.

10. On the Package Recovery page, you can verify that software distribution source files are accessible to the site server and that the local distribution point is up to date. To ensure that the local distribution point is updated with the most recent version of software distribution source files for packages, you can click Update the distribution point on this site server. If a distribution point is not installed locally on the site server to be repaired, this step can be skipped by clicking Skip package verification.

11. On the Summary page, review the summary of site repair actions that you have selected. To change any of the displayed settings, click Back. To begin the repair process, click Next.
Important: After clicking Next on the Summary page, the site repair process will begin, you cannot go back to previous steps.

12. On the Final Progress page, review the steps the Site Repair Wizard takes to repair the site to ensure they have completed successfully and click Next.

13. On the Finish page, review the information displayed and click Close to finish the site repair process and close the Site Repair Wizard.

Restore Procedure’s for Primary Sites

Restore Procedure’s for Primary Sites

1. To start the Site Repair Wizard from the Configuration Manager console:
Navigate to System Center Configuration Manager \ Site Database \ Site Management \ <site name>.

2. Right click <site name> and click Repair Site.

Note: The Site Repair Wizard can only be started from the Configuration Manager console installed on the site server to be repaired. The option to start the Site Repair Wizard is not available on remote Configuration Manager console installations.

Important: If the Local drives on site server and SQL Server destination option has been selected for the backup destination in the Backup ConfigMgr Site Server maintenance task, the site database backup files must be manually copied to the same location as the site data backup files before continuing.

3. On the Backup File Location page, click Browse to open the Browse for Folder dialog box, and browse to the location of the most recent site backup snapshot files (the backup destination specified in the Backup ConfigMgr Site Server maintenance task) and click OK to close the Browse for Folder dialog box.
Note: If the purpose of the site repair is to only recover lost site settings and the site database does not need to be restored, you can enable the Do not restore database option.

4. On the Progress page, review the steps the Site Repair Wizard takes to begin the repair process to ensure that they have completed successfully and click Next.

5. On the Parent Site Settings page, review the parent site settings to ensure that they have not changed since the site was last backed up.

6. On the Verify Site Hierarchy page, verify that the displayed site hierarchy information to be restored from backup is correct. If parent site, child site, or any site address information has changed since the last backup snapshot was created. You can view the site and site sender address properties information stored in the backup snapshot by clicking Properties. If child site was attached to, or detached from, the site to be recovered after the last backup snapshot was created, you can click Add to add the site to the repair information or Remove to remove the site from the site repair information. For new or deleted site sender addresses, you can click New or Delete in Addresses for selected site

7. (Optional). On the Reference Connection page, select a site that was active and accessible to the site to be recovered from the time the last backup snapshot was created and the time the Site Repair Wizard was started. The reference site will be used to recover any objects created at the primary site after the site was last backed up. For example, if a new collection was created at the site to be repaired after it was last backed up, the new collection can be recovered from the child reference site selected in Recover data from reference site.

8. On the Reference Site Data Recovery page, review the steps the Site Repair Wizard takes to recover reference site data to ensure they have completed successfully and click Next.

9. On the Object Pad page, specify and approximate number of Collections, Packages, and Advertisements that were created at this site since it was last backed up. This is to ensure that future collections, advertisements and collections created at the site after it is repaired do not contain duplicate IDs to those previously created. If there is non-zero data displayed in Collections, Packages, and Advertisements, it is based on the data recovered from the reference site.

10. On the Package Recovery page, you can verify that software distribution source files are accessible to the site server and that the local distribution point is up to date. To ensure that the local distribution point is updated with the most recent version of software distribution source files for packages, you can click Update the distribution point on this site server. If a distribution point is not installed locally on the site server to be repaired, this step can be skipped by clicking Skip package verification.

11. On the Summary page, review the summary of site repair actions that you have selected. To change any of the displayed settings, click Back. To begin the repair process, click Next.
Important: After clicking Next on the Summary page, the site repair process will begin, you cannot go back to previous steps.

12. On the Final Progress page, review the steps the Site Repair Wizard takes to repair the site to ensure they have completed successfully and click Next.

13. On the Finish page, review the information displayed and click Close to finish the site repair process and close the Site Repair Wizard.

14 May 2010

Scripts to query installed Service Packs, Patches/updates and Hotfixes

Scripts to query installed Service Packs, Patches/updates and Hotfixes

There are many known scripts which use WMI class Win32_QuickFixEngineering to enumerate hotfixes installed on a computer. These scripts can give you a list of installed updates like;

1.

This Script reports installed updates that are installed with Windows Update (v5) technology and the result will be written to %temp%\UpdateHistory.txt and then launched in Notepad.

USAGE: Cscript //nologo WUhistory.vbs

The output will look like;

Report run at 4/23/2006 2:42:14 PM
------------------------------------------------------------------
Title:   Security Update for Windows XP (KB908531)
Description:  A security issue has been identified in Windows Explorer that could allow an attacker to compromise your Windows-based system and gain control over it. You can help protect your computer by installing this update from Microsoft. After you install this item, you may have to restart your computer.
Date/Time in GMT: 4/18/2006 7:47:14 AM
Install mechanism: AutomaticUpdates
Install status:  Succeeded
------------------------------------------------------------------

'--------------------8<----------------------
' Script that reports installed updates that are
' installed with Windows Update v5 technology
'
' Result will be written to %temp%\UpdateHistory.txt
' and then launched in Notepad
'
' Author: Torgeir Bakken
' Date 2004-08-12
'
Option Explicit

Const OverwriteIfExist = -1
Const OpenAsASCII   =  0

Dim oWU, iTHCount, colUpdate, oUpdate, sStatus, iTotal
Dim iSuccess, iFailed, iAborted, iUnknown, sErrorCode
Dim oFSO, oShell, sFile, f

On Error Resume Next
Set oWU = CreateObject("Microsoft.Update.Searcher")

If Err.Number <> 0 Then
   MsgBox "WU5 programming interface does not exist.", _
          vbInformation + vbSystemModal, "Update history"
   WScript.Quit
End If
On Error Goto 0

iTHCount = oWU.GetTotalHistoryCount
If iTHCount > 0 Then

   Set oFSO = CreateObject("Scripting.FileSystemObject")
   Set oShell = CreateObject("Wscript.Shell")
   sFile = oShell.ExpandEnvironmentStrings("%TEMP%") & "\UpdateHistory.txt"
   Set f = oFSO.CreateTextFile(sFile, _
                      OverwriteIfExist, OpenAsASCII)

   iTotal = 0
   iSuccess = 0
   iFailed = 0
   iAborted = 0
   iUnknown = 0

   f.WriteLine "Report run at " & Now
     f.WriteLine "---------------------------------" _
           & "---------------------------------"

   Set colUpdate = oWU.QueryHistory(0, iTHCount)

   For Each oUpdate In colUpdate
     f.WriteLine "Title:" & vbTab & vbTab & vbTab & oUpdate.Title
     f.WriteLine "Description:" & vbTab & vbTab & oUpdate.Description
     f.WriteLine "Date/Time in GMT:" & vbTab & oUpdate.Date
     f.WriteLine "Install mechanism:" & vbTab & oUpdate.ClientApplicationID

     sErrorCode = ""
     Select Case oUpdate.ResultCode
       Case 2
         sStatus = "Succeeded"
         iSuccess = iSuccess + 1
       Case 4
         sStatus = "Failed"
         iFailed = iFailed + 1
         sErrorCode = oUpdate.UnmappedResultCode
       Case 5
         sStatus = "Aborted"
         iAborted = iAborted + 1
       Case Else
         sStatus = "Unknown"
         iUnknown = iUnknown + 1
     End Select

     If sStatus = "Failed" Then
       f.WriteLine "Install error:" & vbTab & vbTab & sErrorCode
     End If

     f.WriteLine "Install status:" & vbTab & vbTab & sStatus
     f.WriteLine "---------------------------------" _
           & "---------------------------------"

     iTotal = iTotal + 1
   Next

   f.WriteLine
   f.WriteLine "Total number of updates found: " & iTotal
   f.WriteLine "Number of updates succeeded: " & iSuccess
   f.WriteLine "Number of updates failed: " & iFailed
   f.WriteLine "Number of updates aborted: " & iAborted

   f.Close
   oShell.Run "notepad.exe " & """" & sFile & """", 1, False
Else

   MsgBox "No entries found in Update History.", _
          vbInformation + vbSystemModal, "Update history"

End If
'--------------------8<----------------------

2.

This script enumerate hotfixes installed on a computer and outputs some computer information.

USAGE: Cscript //nologo HotfixHistory.vbs > HotfixHistory.txt

The output will look like;

Hotfix report date: 4/23/2006 2:45:19 PM

OS version: Microsoft Windows XP Professional
SP version: Service Pack 2
OS language: English

HotFixID: KB873339
Description: Windows XP Hotfix - KB873339
InstalledBy: Administrator
InstallDate: 12/11/2005

'
' Description: Script that outputs some computer information
' and lists all installed hotfixes including installation date
'
' Author: Torgeir Bakken
' Date: 2004-10-19
'

Wscript.Echo "Hotfix report date: " & Now & vbCrLf

strComputer = "."   ' use "." for local computer

Const HKLM = &H80000002

'On Error Resume Next
Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery _
        ("Select * from Win32_OperatingSystem")

' get general info about the OS

' Caption value for different OS:
' Microsoft Windows 2000 ...
' Microsoft Windows XP ...
' Microsoft(R) Windows(R) Server 2003, ..... Edition
For Each objOperatingSystem in colSettings
    strOSCaption = objOperatingSystem.Caption
    Select Case True
      Case InStr(1, strOSCaption, "windows 2000", vbTextCompare) > 0
        strOS = "Windows 2000"
      Case InStr(1, strOSCaption, "windows xp", vbTextCompare) > 0
        strOS = "Windows XP"
      Case InStr(1, strOSCaption, "windows(r) server 2003", vbTextCompare) > 0
        strOS = "Windows Server 2003"
    End Select

    intOSLang = objOperatingSystem.OSLanguage
    strOSLangHex = Right("000" & Hex(intOSLang), 4)
    strOSServicePack = objOperatingSystem.CSDVersion
Next

Set objReg = GetObject("WinMgmts:{impersonationLevel=impersonate}!//" _
              & strComputer & "/root/default:StdRegProv")

strOSLanguage = "Unknown"  ' Init value
strKeyPath = "SOFTWARE\Classes\MIME\Database\Rfc1766"
strValueName = strOSLangHex
objReg.GetStringValue HKLM, strKeyPath, strValueName, strOSLanguage

' remove unnecessary stuff
arrOSLanguage = Split(strOSLanguage, ";")
strOSLanguage = arrOSLanguage(UBound(arrOSLanguage))
If Instr(strOSLanguage, "(") > 0 Then
    arrOSLanguage = Split(strOSLanguage, "(")
    strOSLanguage = Trim(arrOSLanguage(0))
End If

Wscript.Echo "OS version: " & strOSCaption
Wscript.Echo "SP version: " & strOSServicePack
Wscript.Echo "OS language: " & strOSLanguage

' start enumeration of hotfixes

Wscript.Echo vbCrLf & "Hotfixes Identified:"

strRegBaseUpdate = "SOFTWARE\Microsoft\Updates\" & strOS

Set colItems = objWMIService.ExecQuery _
        ("Select * from Win32_QuickFixEngineering",,48)

For Each objItem in colItems
    If objItem.HotFixID <> "File 1" Then
       Wscript.Echo "HotFixID: " & objItem.HotFixID
       Wscript.Echo "Description: " & objItem.Description
       Wscript.Echo "InstalledBy: " & objItem.InstalledBy
       strInstallDate = Null  ' init value
       If objItem.ServicePackInEffect <> "" Then
          strRegKey = strRegBaseUpdate & "\" & objItem.ServicePackInEffect _
                 & "\" & objItem.HotFixID
          objReg.GetStringValue HKLM, strRegKey, _
               "InstalledDate", strInstallDate
       End If

       If IsNull(strInstallDate) Then
          strInstallDate = "(none found)"
       End If
       Wscript.Echo "InstallDate: " & strInstallDate
       Wscript.Echo   ' blank line
    End If
Next
'--------------------8<----------------------

3.

I found this script in the community. Worth a try!

'--------------------8<----------------------

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
    ("Select * from Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
    Wscript.Echo "Computer: " & objQuickFix.CSName
    Wscript.Echo "Description: " & objQuickFix.Description
    Wscript.Echo "Hot Fix ID: " & objQuickFix.HotFixID
    Wscript.Echo "Installation Date: " & objQuickFix.InstallDate
    Wscript.Echo "Installed By: " & objQuickFix.InstalledBy
Next

'--------------------8<----------------------

4.

Very recently, I found this GUI utility by name WinUpdatesList.

  • WinUpdatesList displays the list of all Windows updates (Service Packs and Hotfixes) installed on your local computer.
  • For hotfix updates, this utility also displays the list of files updated with these hotfixes.
  • In addition, it allows you to instantly open the Web link in Microsoft Web site that provides more information about the selected update, uninstall an update, copy the update information to the clipboard, or save it to text/HTML/XML file.

5.

You can also query list of updates /hotfixes installed by this simple command (one line). Replace 'server-name' with your server or your machine name;

wmic /node:'server-name' qfe GET description,FixComments,hotfixid,installedby,installedon,servicepackineffect

You can also output the result to a text / csv file;

wmic /node:'server-name' qfe GET description,FixComments,hotfixid,installedby,installedon,servicepackineffect > QFElist.txt

Scripts to query installed Service Packs, Patches/updates and Hotfixes

Scripts to query installed Service Packs, Patches/updates and Hotfixes

There are many known scripts which use WMI class Win32_QuickFixEngineering to enumerate hotfixes installed on a computer. These scripts can give you a list of installed updates like;

1.

This Script reports installed updates that are installed with Windows Update (v5) technology and the result will be written to %temp%\UpdateHistory.txt and then launched in Notepad.

USAGE: Cscript //nologo WUhistory.vbs

The output will look like;

Report run at 4/23/2006 2:42:14 PM
------------------------------------------------------------------
Title:   Security Update for Windows XP (KB908531)
Description:  A security issue has been identified in Windows Explorer that could allow an attacker to compromise your Windows-based system and gain control over it. You can help protect your computer by installing this update from Microsoft. After you install this item, you may have to restart your computer.
Date/Time in GMT: 4/18/2006 7:47:14 AM
Install mechanism: AutomaticUpdates
Install status:  Succeeded
------------------------------------------------------------------

'--------------------8<----------------------
' Script that reports installed updates that are
' installed with Windows Update v5 technology
'
' Result will be written to %temp%\UpdateHistory.txt
' and then launched in Notepad
'
' Author: Torgeir Bakken
' Date 2004-08-12
'
Option Explicit

Const OverwriteIfExist = -1
Const OpenAsASCII   =  0

Dim oWU, iTHCount, colUpdate, oUpdate, sStatus, iTotal
Dim iSuccess, iFailed, iAborted, iUnknown, sErrorCode
Dim oFSO, oShell, sFile, f

On Error Resume Next
Set oWU = CreateObject("Microsoft.Update.Searcher")

If Err.Number <> 0 Then
   MsgBox "WU5 programming interface does not exist.", _
          vbInformation + vbSystemModal, "Update history"
   WScript.Quit
End If
On Error Goto 0

iTHCount = oWU.GetTotalHistoryCount
If iTHCount > 0 Then

   Set oFSO = CreateObject("Scripting.FileSystemObject")
   Set oShell = CreateObject("Wscript.Shell")
   sFile = oShell.ExpandEnvironmentStrings("%TEMP%") & "\UpdateHistory.txt"
   Set f = oFSO.CreateTextFile(sFile, _
                      OverwriteIfExist, OpenAsASCII)

   iTotal = 0
   iSuccess = 0
   iFailed = 0
   iAborted = 0
   iUnknown = 0

   f.WriteLine "Report run at " & Now
     f.WriteLine "---------------------------------" _
           & "---------------------------------"

   Set colUpdate = oWU.QueryHistory(0, iTHCount)

   For Each oUpdate In colUpdate
     f.WriteLine "Title:" & vbTab & vbTab & vbTab & oUpdate.Title
     f.WriteLine "Description:" & vbTab & vbTab & oUpdate.Description
     f.WriteLine "Date/Time in GMT:" & vbTab & oUpdate.Date
     f.WriteLine "Install mechanism:" & vbTab & oUpdate.ClientApplicationID

     sErrorCode = ""
     Select Case oUpdate.ResultCode
       Case 2
         sStatus = "Succeeded"
         iSuccess = iSuccess + 1
       Case 4
         sStatus = "Failed"
         iFailed = iFailed + 1
         sErrorCode = oUpdate.UnmappedResultCode
       Case 5
         sStatus = "Aborted"
         iAborted = iAborted + 1
       Case Else
         sStatus = "Unknown"
         iUnknown = iUnknown + 1
     End Select

     If sStatus = "Failed" Then
       f.WriteLine "Install error:" & vbTab & vbTab & sErrorCode
     End If

     f.WriteLine "Install status:" & vbTab & vbTab & sStatus
     f.WriteLine "---------------------------------" _
           & "---------------------------------"

     iTotal = iTotal + 1
   Next

   f.WriteLine
   f.WriteLine "Total number of updates found: " & iTotal
   f.WriteLine "Number of updates succeeded: " & iSuccess
   f.WriteLine "Number of updates failed: " & iFailed
   f.WriteLine "Number of updates aborted: " & iAborted

   f.Close
   oShell.Run "notepad.exe " & """" & sFile & """", 1, False
Else

   MsgBox "No entries found in Update History.", _
          vbInformation + vbSystemModal, "Update history"

End If
'--------------------8<----------------------

2.

This script enumerate hotfixes installed on a computer and outputs some computer information.

USAGE: Cscript //nologo HotfixHistory.vbs > HotfixHistory.txt

The output will look like;

Hotfix report date: 4/23/2006 2:45:19 PM

OS version: Microsoft Windows XP Professional
SP version: Service Pack 2
OS language: English

HotFixID: KB873339
Description: Windows XP Hotfix - KB873339
InstalledBy: Administrator
InstallDate: 12/11/2005

'
' Description: Script that outputs some computer information
' and lists all installed hotfixes including installation date
'
' Author: Torgeir Bakken
' Date: 2004-10-19
'

Wscript.Echo "Hotfix report date: " & Now & vbCrLf

strComputer = "."   ' use "." for local computer

Const HKLM = &H80000002

'On Error Resume Next
Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery _
        ("Select * from Win32_OperatingSystem")

' get general info about the OS

' Caption value for different OS:
' Microsoft Windows 2000 ...
' Microsoft Windows XP ...
' Microsoft(R) Windows(R) Server 2003, ..... Edition
For Each objOperatingSystem in colSettings
    strOSCaption = objOperatingSystem.Caption
    Select Case True
      Case InStr(1, strOSCaption, "windows 2000", vbTextCompare) > 0
        strOS = "Windows 2000"
      Case InStr(1, strOSCaption, "windows xp", vbTextCompare) > 0
        strOS = "Windows XP"
      Case InStr(1, strOSCaption, "windows(r) server 2003", vbTextCompare) > 0
        strOS = "Windows Server 2003"
    End Select

    intOSLang = objOperatingSystem.OSLanguage
    strOSLangHex = Right("000" & Hex(intOSLang), 4)
    strOSServicePack = objOperatingSystem.CSDVersion
Next

Set objReg = GetObject("WinMgmts:{impersonationLevel=impersonate}!//" _
              & strComputer & "/root/default:StdRegProv")

strOSLanguage = "Unknown"  ' Init value
strKeyPath = "SOFTWARE\Classes\MIME\Database\Rfc1766"
strValueName = strOSLangHex
objReg.GetStringValue HKLM, strKeyPath, strValueName, strOSLanguage

' remove unnecessary stuff
arrOSLanguage = Split(strOSLanguage, ";")
strOSLanguage = arrOSLanguage(UBound(arrOSLanguage))
If Instr(strOSLanguage, "(") > 0 Then
    arrOSLanguage = Split(strOSLanguage, "(")
    strOSLanguage = Trim(arrOSLanguage(0))
End If

Wscript.Echo "OS version: " & strOSCaption
Wscript.Echo "SP version: " & strOSServicePack
Wscript.Echo "OS language: " & strOSLanguage

' start enumeration of hotfixes

Wscript.Echo vbCrLf & "Hotfixes Identified:"

strRegBaseUpdate = "SOFTWARE\Microsoft\Updates\" & strOS

Set colItems = objWMIService.ExecQuery _
        ("Select * from Win32_QuickFixEngineering",,48)

For Each objItem in colItems
    If objItem.HotFixID <> "File 1" Then
       Wscript.Echo "HotFixID: " & objItem.HotFixID
       Wscript.Echo "Description: " & objItem.Description
       Wscript.Echo "InstalledBy: " & objItem.InstalledBy
       strInstallDate = Null  ' init value
       If objItem.ServicePackInEffect <> "" Then
          strRegKey = strRegBaseUpdate & "\" & objItem.ServicePackInEffect _
                 & "\" & objItem.HotFixID
          objReg.GetStringValue HKLM, strRegKey, _
               "InstalledDate", strInstallDate
       End If

       If IsNull(strInstallDate) Then
          strInstallDate = "(none found)"
       End If
       Wscript.Echo "InstallDate: " & strInstallDate
       Wscript.Echo   ' blank line
    End If
Next
'--------------------8<----------------------

3.

I found this script in the community. Worth a try!

'--------------------8<----------------------

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
    ("Select * from Win32_QuickFixEngineering")
For Each objQuickFix in colQuickFixes
    Wscript.Echo "Computer: " & objQuickFix.CSName
    Wscript.Echo "Description: " & objQuickFix.Description
    Wscript.Echo "Hot Fix ID: " & objQuickFix.HotFixID
    Wscript.Echo "Installation Date: " & objQuickFix.InstallDate
    Wscript.Echo "Installed By: " & objQuickFix.InstalledBy
Next

'--------------------8<----------------------

4.

Very recently, I found this GUI utility by name WinUpdatesList.

  • WinUpdatesList displays the list of all Windows updates (Service Packs and Hotfixes) installed on your local computer.
  • For hotfix updates, this utility also displays the list of files updated with these hotfixes.
  • In addition, it allows you to instantly open the Web link in Microsoft Web site that provides more information about the selected update, uninstall an update, copy the update information to the clipboard, or save it to text/HTML/XML file.

5.

You can also query list of updates /hotfixes installed by this simple command (one line). Replace 'server-name' with your server or your machine name;

wmic /node:'server-name' qfe GET description,FixComments,hotfixid,installedby,installedon,servicepackineffect

You can also output the result to a text / csv file;

wmic /node:'server-name' qfe GET description,FixComments,hotfixid,installedby,installedon,servicepackineffect > QFElist.txt