As posted in my previous post Windows 2008 default enables hibernation.
This timed script is designed to monitor on which servers the hiberfil.sys is active and run a console task to disable this.
This is an example how to use a timed script two state monitor to monitor a file exists. If the file hiberfil.sys exists the monitor is in error state.
Create the Two State Monitor
- Go to authoring, monitor and create a new unit monitor
- Choose Timed Script Two State Monitor

- Give it a name, target it to ““Windows Server 2008 Operating System” and set parent monitor to “Availibility”
- Schedule it when to run (we used every week)
- Input the script below
‘ check if hiberfil.sys is available
‘ and create a alert when its there
Dim oAPI, oBag
set oAPI = CreateObject(“MOM.ScriptAPI”)
set oBag = oAPI.CreatePropertyBag()
set objFSO = CreateObject(“Scripting.FileSystemObject”)
strFile = “C:\hiberfil.sys”
If objFSO.FileExists(strFile) Then
Call oBag.AddValue(“Status”,”Error”)
Call oAPI.Return(oBag)
Else
Call oBag.AddValue(“Status”,”Ok”)
Call oAPI.Return(oBag)
End If - As unhealthy expression input “Property[@Name='Status'] equals Error”

- As healthy expression input “Property[@Name='Status'] equals Ok”

- Fill in the proper alert settings

Create the “console task”
- Go to the authoring pane, Tasks and create a new task

- Select Agent Tasks, Command line

- Fill in the following commands

After this is finished the OpsMgr server will generate an alert when the Hiberfil.sys file is active and you can disable hybernation from the console!



One Response
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Continuing the Discussion