Vista SP1 Installations Deployed Using Operating System Deployment Cannot Hibernate

This was posted by Nathan Barnett over in one of the ConfigMgr 2007 forums so I thought you might like a heads up here as well:

========

Issue

When the Configuration Manager 2007 operating system deployment feature is used to deploy a Vista SP1 image, a new boot configuration data (BCD) store is created using the BCD template.  Configuration Manager 2007 explicitly creates the Boot Manger and Operating System objects from the BCD template, but allows the Resume object to be created implicitly by Windows Vista when it goes through mini-setup.  Vista SP1 correctly generates the Resume object during mini-setup but the associated Resume settings objects are not generated. Because there are no Resume settings objects, hibernate functionality does not work.

Solution

To resolve this issue, run the following script on Vista SP1 computers deployed using Configuration Manager 2007 operating system deployment to create the missing Resume settings objects. To run the script type the following at a command prompt

cscript.exe /nologo scriptname.vbs

This script can be deployed in two scenarios:

· Run as part of the Vista SP1 deployment: Incorporate the script into the operating system deployment task sequence as a Run Command Line step once the new operating system is installed.  

· Run after Vista SP installation: Incorporate the script into a software distribution package/program and then advertise it to existing computers previously deployed with Vista SP1 using Configuration Manager 2007 SP1. 

Code Snippet:

' Connect to WMI
set oLocator = CreateObject( "WbemScripting.SWbemLocator" )
set oRootWMI = oLocator.ConnectServer( ".", "root\wmi" )
oRootWMI.Security_.ImpersonationLevel = 3

' Connect to BCD
set oBCD = GetObject( "winmgmts:{impersonationlevel=Impersonate,(Backup,Restore)}!root/wmi:BcdStore")
if Err.number <> 0 then
WScript.Echo "ERROR: Failed to connect to BCD"
WScript.Quit(1)
end if

' Open the system store
if not oBCD.OpenStore( "", oBcdStore ) then
WScript.Echo "ERROR: Failed to open the system BCD store"
WScript.Quit(1)
end if
set oBCD = nothing

const ResumeLoaderSettingsBcdObject = "{1afa9c49-16ab-4a5c-901b-212802da9460}"
const GlobalSettingsBcdObject = "{7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}"

' Check to see if the {resumeloadersettings} object already exists
if oBcdStore.OpenObject( ResumeLoaderSettingsBcdObject, objWBM ) then
WScript.Echo "Resume Loader Settings object already exists in BCD"
WScript.Echo "No changes have been made to the system"
WScript.Quit(1)
end if

WScript.Echo "Creating new {resumeloadersettings} object..."
if not oBcdStore.CreateObject( ResumeLoaderSettingsBcdObject, &h20200004, oResumeSettings) then
WScript.Echo "ERROR: Failed to create the BCD object"
end if

if not oResumeSettings.SetObjectListElement(&h14000006, Array(GlobalSettingsBcdObject )) then
WScript.Echo "ERROR: Failed to set the Inherit element"
end if

WScript.Echo "Finished updating BCD"

========

You can read the original post here.  Enjoy!

J.C. Hornbeck | Manageability Knowledge Engineer