17 May 2010

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

08 May 2010

create 1000 users

' Create 1000 Sample User Accounts


Set objRootDSE = GetObject("LDAP://rootDSE")

Set objContainer = GetObject("LDAP://cn=Users," & _
objRootDSE.Get("defaultNamingContext"))

For i = 1 To 1000
Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
objLeaf.Put "sAMAccountName", "UserNo" & i
objLeaf.SetInfo
Next

WScript.Echo "1000 Users created."

create 1000 users

' Create 1000 Sample User Accounts


Set objRootDSE = GetObject("LDAP://rootDSE")

Set objContainer = GetObject("LDAP://cn=Users," & _
objRootDSE.Get("defaultNamingContext"))

For i = 1 To 1000
Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
objLeaf.Put "sAMAccountName", "UserNo" & i
objLeaf.SetInfo
Next

WScript.Echo "1000 Users created."

'Below script to create number of computers in AD--for testing

'Below script to create number of computers in AD--for testing

'==============================================================================
'
' Description: This script creates multiple sequential computer accounts
' in an AD OU. It appends a 3 digit number to the base name starting with
' the number entered at the prompt.
' ==============================================================================
Option Explicit
'Define Constants
Const ADS_SCOPE_ONELEVEL = 1
'Declare Variables
Dim DQ
Dim strAdmin
Dim intRecord
Dim objShell
Dim objNetwork
Dim intWarn
Dim objRootDSE
Dim strADsPath
Dim objConnection
Dim objCommand
Dim strOUPath
Dim objRecordSet
Dim strBaseName
Dim intRecordMax
Dim bEnabled
Dim objOU
Dim strNewComputerName
Dim objNewComputer
Dim strDomainDN
Dim strDomainFQDN
Dim intOULevel
Dim strSearchADsPath
Dim intStartNumber
'Set variables
DQ = Chr(34)
'Create Objects
Set objShell = CreateObject("Wscript.Shell")
Set objNetwork = CreateObject("WScript.NetWork")
'Verifies script was run using Cscript, and if not relauches it using Cscript
If Not WScript.FullName = WScript.Path & "\cscript.exe" Then

objShell.Popup "Relaunching script with Cscript in 5 seconds...", 5, _
"Script Host Message", 48

objShell.Run "cmd.exe /k " & WScript.Path & "\cscript.exe //NOLOGO " & _
DQ & WScript.scriptFullName & DQ, 1, False

Script.Quit 0
End If

'Warn User
intWarn = MsgBox("This will make changes to AD." & VbCr & _
"Are you sure you want to do this?", 308, "ID 10 T Check")
'308 = Yes/No (4) + 'Exclaimation (48) + Default Button 2 (256)
If intWarn = vbNo Then

WScript.Quit 0
End If
'Construct an ADsPath to the Current Domain with rootDSE
Set objRootDSE = GetObject("LDAP://rootDSE")
strADsPath = "LDAP://" & objRootDSE.Get("defaultNamingContext")
'Convert domain Distinguished Name to FQDN format
strDomainDN = objRootDSE.Get("defaultNamingContext")
strDomainFQDN = Replace(Replace(strDomainDN, "DC=", ""), ",", ".")
'Connect to Active Directory
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_ONELEVEL
'Prompt for Path to OU
Do

strOUPath = _
InputBox("Please enter the path to the OU where the computer accounts " & _
" will be created - Seperate OUs With a \", "OU Path Input", "TopOU\SubOU")
If strOUPath = False Then
WScript.Quit

End If
Loop Until strOUPath <> ""


'Split OU path by OU
strOUPath = UCase(strOUPath)
strOUPath = Split(strOUPath, "\")


'Prepare variables for search
intOULevel = 0
strSearchADsPath = strADsPath


'Search through each OU level in path provided
For intOULevel = 0 To UBound(strOUPath)

objCommand.CommandText = "SELECT ADsPath FROM '" & strSearchADsPath & _
"'" & " WHERE objectCategory='organizationalUnit' AND Name = '" & _
strOUPath(intOULevel) & "'"

Set objRecordSet = objCommand.Execute

'Verify OU was found

If objRecordSet.EOF Then

WScript.echo "OU named " & strOUPath(intOULevel) & _
" not found, Exiting script."

WScript.quit

Else

objRecordSet.MoveFirst
Do Until objRecordSet.EOF
strSearchADsPath = objRecordSet.Fields("ADsPath").Value
objRecordSet.MoveNext
Loop
End If
Next
'Get current username to use in description field
strAdmin = objNetwork.UserName
'Prompt for the base computer name
Do
strBaseName = _
InputBox("Please enter the base computer name to use for new accounts:", _
"Base Computer Name", "TestPC")
If strBaseName = False Then
WScript.Quit
End If
Loop Until strBaseName <> ""
strBaseName = UCase(strBaseName)
'Prompt for starting computer number
Do

intStartNumber = _
InputBox("Please enter the beginning number to use in computer names:", _
"Starting Computer Number", "001")
If intStartNumber = False Then

WScript.Quit

End If
Loop Until intStartNumber <> ""
intStartNumber = CInt(intStartNumber)
intRecord = intStartNumber
'Prompt for number of accounts to be created
Do

intRecordMax = _
InputBox("Please enter the number of accounts to be created", _
"Count Input", "10")
If intRecordMax = False Then

WScript.Quit

End If
Loop Until intRecordMax <> ""
intRecordMax = CInt(intRecordMax)


'Bind to OU that computers will be created in
Set objOU = GetObject(strSearchADsPath)

'Create the user accounts
Do Until intRecord = intRecordMax + intStartNumber
intRecord = Right("000" & intRecord, 3)
strNewComputerName = strBaseName & intRecord
WScript.Echo "Creating " & strNewComputerName
Set objNewComputer = objOU.Create("Computer", "cn= " & strNewComputerName)
objNewComputer.Put "samAccountName", strNewComputerName & "$"
objNewComputer.Put "userAccountControl", 4096
objNewComputer.Put "description", "Account created: " & Date() & " by: " _
& strAdmin
objNewComputer.SetInfo 'Writes settings to AD
intRecord = intRecord + 1
Loop

WScript.Echo
WScript.echo "Finished creating computer accounts."

'Below script to create number of computers in AD--for testing

'Below script to create number of computers in AD--for testing

'==============================================================================
'
' Description: This script creates multiple sequential computer accounts
' in an AD OU. It appends a 3 digit number to the base name starting with
' the number entered at the prompt.
' ==============================================================================
Option Explicit
'Define Constants
Const ADS_SCOPE_ONELEVEL = 1
'Declare Variables
Dim DQ
Dim strAdmin
Dim intRecord
Dim objShell
Dim objNetwork
Dim intWarn
Dim objRootDSE
Dim strADsPath
Dim objConnection
Dim objCommand
Dim strOUPath
Dim objRecordSet
Dim strBaseName
Dim intRecordMax
Dim bEnabled
Dim objOU
Dim strNewComputerName
Dim objNewComputer
Dim strDomainDN
Dim strDomainFQDN
Dim intOULevel
Dim strSearchADsPath
Dim intStartNumber
'Set variables
DQ = Chr(34)
'Create Objects
Set objShell = CreateObject("Wscript.Shell")
Set objNetwork = CreateObject("WScript.NetWork")
'Verifies script was run using Cscript, and if not relauches it using Cscript
If Not WScript.FullName = WScript.Path & "\cscript.exe" Then

objShell.Popup "Relaunching script with Cscript in 5 seconds...", 5, _
"Script Host Message", 48

objShell.Run "cmd.exe /k " & WScript.Path & "\cscript.exe //NOLOGO " & _
DQ & WScript.scriptFullName & DQ, 1, False

Script.Quit 0
End If

'Warn User
intWarn = MsgBox("This will make changes to AD." & VbCr & _
"Are you sure you want to do this?", 308, "ID 10 T Check")
'308 = Yes/No (4) + 'Exclaimation (48) + Default Button 2 (256)
If intWarn = vbNo Then

WScript.Quit 0
End If
'Construct an ADsPath to the Current Domain with rootDSE
Set objRootDSE = GetObject("LDAP://rootDSE")
strADsPath = "LDAP://" & objRootDSE.Get("defaultNamingContext")
'Convert domain Distinguished Name to FQDN format
strDomainDN = objRootDSE.Get("defaultNamingContext")
strDomainFQDN = Replace(Replace(strDomainDN, "DC=", ""), ",", ".")
'Connect to Active Directory
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_ONELEVEL
'Prompt for Path to OU
Do

strOUPath = _
InputBox("Please enter the path to the OU where the computer accounts " & _
" will be created - Seperate OUs With a \", "OU Path Input", "TopOU\SubOU")
If strOUPath = False Then
WScript.Quit

End If
Loop Until strOUPath <> ""


'Split OU path by OU
strOUPath = UCase(strOUPath)
strOUPath = Split(strOUPath, "\")


'Prepare variables for search
intOULevel = 0
strSearchADsPath = strADsPath


'Search through each OU level in path provided
For intOULevel = 0 To UBound(strOUPath)

objCommand.CommandText = "SELECT ADsPath FROM '" & strSearchADsPath & _
"'" & " WHERE objectCategory='organizationalUnit' AND Name = '" & _
strOUPath(intOULevel) & "'"

Set objRecordSet = objCommand.Execute

'Verify OU was found

If objRecordSet.EOF Then

WScript.echo "OU named " & strOUPath(intOULevel) & _
" not found, Exiting script."

WScript.quit

Else

objRecordSet.MoveFirst
Do Until objRecordSet.EOF
strSearchADsPath = objRecordSet.Fields("ADsPath").Value
objRecordSet.MoveNext
Loop
End If
Next
'Get current username to use in description field
strAdmin = objNetwork.UserName
'Prompt for the base computer name
Do
strBaseName = _
InputBox("Please enter the base computer name to use for new accounts:", _
"Base Computer Name", "TestPC")
If strBaseName = False Then
WScript.Quit
End If
Loop Until strBaseName <> ""
strBaseName = UCase(strBaseName)
'Prompt for starting computer number
Do

intStartNumber = _
InputBox("Please enter the beginning number to use in computer names:", _
"Starting Computer Number", "001")
If intStartNumber = False Then

WScript.Quit

End If
Loop Until intStartNumber <> ""
intStartNumber = CInt(intStartNumber)
intRecord = intStartNumber
'Prompt for number of accounts to be created
Do

intRecordMax = _
InputBox("Please enter the number of accounts to be created", _
"Count Input", "10")
If intRecordMax = False Then

WScript.Quit

End If
Loop Until intRecordMax <> ""
intRecordMax = CInt(intRecordMax)


'Bind to OU that computers will be created in
Set objOU = GetObject(strSearchADsPath)

'Create the user accounts
Do Until intRecord = intRecordMax + intStartNumber
intRecord = Right("000" & intRecord, 3)
strNewComputerName = strBaseName & intRecord
WScript.Echo "Creating " & strNewComputerName
Set objNewComputer = objOU.Create("Computer", "cn= " & strNewComputerName)
objNewComputer.Put "samAccountName", strNewComputerName & "$"
objNewComputer.Put "userAccountControl", 4096
objNewComputer.Put "description", "Account created: " & Date() & " by: " _
& strAdmin
objNewComputer.SetInfo 'Writes settings to AD
intRecord = intRecord + 1
Loop

WScript.Echo
WScript.echo "Finished creating computer accounts."

04 May 2010

Dell PowerEdge R510 server

Specifications

  • Processor: Up to two Intel Xeon 5500 and 5600 processors, up to six cores per socket, up to 12 sockets per server.
  • RAM: Up to 64 GB, 128 GB, or 192 GB DDR3 RAM, depending on which Dell resource you use. (See “RAM options are inconsistent” in the What’s wrong section below for more information.)
  • RAID: Wide variety of RAID controller options to support internal and external storage.
  • Drive bays: Chassis options include 4, 8, or 12 drive bays.
  • Drive options: Up to 12 disks at 2 TB each. Supports 2.5″ and 3.5″ SATA and DAS disks and includes a solid state disk option. The 12 disk chassis also has space for two more internal drives.
  • Network: 2 x 1 Gb Ethernet ports on board (Broadcom 5716).
  • Power: Redundant power supply available.
  • Additional information: Product Web site
  • Photos of the Dell PowerEdge R510

The target market

The Dell PowerEdge R510 server is aimed squarely at space-constrained data centers or small and medium-size organizations. I see these primary use cases:

  • Common platform: Organizations that want significant server use flexibility and also want a common platform to administrative ease. The Dell PowerEdge R510’s versatility makes it a natural fit for many applications.
  • Smaller is better: Organizations that need to pack more servers into a data center and that don’t want to move to blades to gain density. The Dell PowerEdge R510’s 26″ depth makes it possible to support this need.
  • Mega storage needed: Small and medium organizations that need a server with massive internal storage and that may not want to invest in a SAN.

What problem does it solve

Many organizations have a desire to standardize on a single server platform in order to make it easier to support the server environment and to keep spare parts on hand in the event of a failure; however, those organizations often have a wide variety of computing needs, each requiring different computing resources. A VMware host, for example, will need RAM and processing power and will generally be connected to a SAN. Exchange, on the other hand, needs RAM, processing power, and raw disk space. SQL Server has similar needs. With its flexible chassis options, dual quad-core processing capability, and support for triple digit GBs of RAM, the 2U Dell PowerEdge R510 can meet the needs for all but the most processor intensive applications. IT can deploy a wide array of services on this single computing platform without sacrificing in any area of the computing spectrum.

The Dell PowerEdge R510 is also a short server, measuring only 26″ deep. This makes it an ideal choice for smaller organizations that have small data centers and need to eke out as much space as possible without sacrifice.

Standout features

In addition to offering very flexible computing options and having a short depth, the Dell PowerEdge R510 offers an optional LCD display that allows administrators to quickly determine chassis status and choose boot options. The availability of the display is dependent on which chassis option is selected. For example, as you will see in the photo gallery, getting a display on the 12 chassis model would be tough.

What’s wrong

Processor density
This is not a specific product issue, but rather a gap in Dell’s line. Ideally, I’d love to see the company release a version of the Dell PowerEdge R510 with support for up to four processors. Obviously, with a short depth, support for a lot of RAM and 12 disks crammed in the existing chassis, this four-socket dream might be difficult to produce in this form factor.

RAM options are inconsistent
Another negative element of this server is not necessarily a knock on the server itself — instead, it’s directed at Dell’s marketing folks. I got frustrated when I looked at various views of the Dell PowerEdge R510 on Dell’s site. Depending on the page being viewed, the site lists the server’s maximum RAM at three values:

In purchasing a server, the maximum RAM configuration available at present is 128 GB.

In the Dell PowerEdge R510’s complete technical guide, there is mention that the chassis selected also impacts the availability of certain RAM configurations. The 4 drive chassis is listed as accepting 1, 2, and 4 GB memory modules; the 8 drive chassis is shown as accepting 1, 2, 4, 8, and 16 GB modules.

My recommendation: Work with your sales rep to make sure your system has the memory options you expect and need.

Competitive products

Bottom line for business

The Dell PowerEdge R510 server is a very welcome addition to Dell’s server lineup and certainly fills an important niche by providing a single-platform solution to organizations that have a wide variety of needs.

Dell PowerEdge R510 server

Specifications

  • Processor: Up to two Intel Xeon 5500 and 5600 processors, up to six cores per socket, up to 12 sockets per server.
  • RAM: Up to 64 GB, 128 GB, or 192 GB DDR3 RAM, depending on which Dell resource you use. (See “RAM options are inconsistent” in the What’s wrong section below for more information.)
  • RAID: Wide variety of RAID controller options to support internal and external storage.
  • Drive bays: Chassis options include 4, 8, or 12 drive bays.
  • Drive options: Up to 12 disks at 2 TB each. Supports 2.5″ and 3.5″ SATA and DAS disks and includes a solid state disk option. The 12 disk chassis also has space for two more internal drives.
  • Network: 2 x 1 Gb Ethernet ports on board (Broadcom 5716).
  • Power: Redundant power supply available.
  • Additional information: Product Web site
  • Photos of the Dell PowerEdge R510

The target market

The Dell PowerEdge R510 server is aimed squarely at space-constrained data centers or small and medium-size organizations. I see these primary use cases:

  • Common platform: Organizations that want significant server use flexibility and also want a common platform to administrative ease. The Dell PowerEdge R510’s versatility makes it a natural fit for many applications.
  • Smaller is better: Organizations that need to pack more servers into a data center and that don’t want to move to blades to gain density. The Dell PowerEdge R510’s 26″ depth makes it possible to support this need.
  • Mega storage needed: Small and medium organizations that need a server with massive internal storage and that may not want to invest in a SAN.

What problem does it solve

Many organizations have a desire to standardize on a single server platform in order to make it easier to support the server environment and to keep spare parts on hand in the event of a failure; however, those organizations often have a wide variety of computing needs, each requiring different computing resources. A VMware host, for example, will need RAM and processing power and will generally be connected to a SAN. Exchange, on the other hand, needs RAM, processing power, and raw disk space. SQL Server has similar needs. With its flexible chassis options, dual quad-core processing capability, and support for triple digit GBs of RAM, the 2U Dell PowerEdge R510 can meet the needs for all but the most processor intensive applications. IT can deploy a wide array of services on this single computing platform without sacrificing in any area of the computing spectrum.

The Dell PowerEdge R510 is also a short server, measuring only 26″ deep. This makes it an ideal choice for smaller organizations that have small data centers and need to eke out as much space as possible without sacrifice.

Standout features

In addition to offering very flexible computing options and having a short depth, the Dell PowerEdge R510 offers an optional LCD display that allows administrators to quickly determine chassis status and choose boot options. The availability of the display is dependent on which chassis option is selected. For example, as you will see in the photo gallery, getting a display on the 12 chassis model would be tough.

What’s wrong

Processor density
This is not a specific product issue, but rather a gap in Dell’s line. Ideally, I’d love to see the company release a version of the Dell PowerEdge R510 with support for up to four processors. Obviously, with a short depth, support for a lot of RAM and 12 disks crammed in the existing chassis, this four-socket dream might be difficult to produce in this form factor.

RAM options are inconsistent
Another negative element of this server is not necessarily a knock on the server itself — instead, it’s directed at Dell’s marketing folks. I got frustrated when I looked at various views of the Dell PowerEdge R510 on Dell’s site. Depending on the page being viewed, the site lists the server’s maximum RAM at three values:

In purchasing a server, the maximum RAM configuration available at present is 128 GB.

In the Dell PowerEdge R510’s complete technical guide, there is mention that the chassis selected also impacts the availability of certain RAM configurations. The 4 drive chassis is listed as accepting 1, 2, and 4 GB memory modules; the 8 drive chassis is shown as accepting 1, 2, 4, 8, and 16 GB modules.

My recommendation: Work with your sales rep to make sure your system has the memory options you expect and need.

Competitive products

Bottom line for business

The Dell PowerEdge R510 server is a very welcome addition to Dell’s server lineup and certainly fills an important niche by providing a single-platform solution to organizations that have a wide variety of needs.