Wednesday 27 August 2014

SCOM - Two State Monitor - Check if Files Exists

This is an example how to use a timed script two state monitor to monitor a file exists. If the file exists the monitor is healthy.

A] Under Authoring > Monitors, create a new Timed Two State Monitor. Give it a name, schedule, target and description

B] Copy this script into the 'Script Window':

Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFile = "C:\Test.txt"
If objFSO.FileExists(strFile) Then
Call oBag.AddValue("Status","Ok")
Call oAPI.Return(oBag)
Else
Call oBag.AddValue("Status","Error")
Call oAPI.Return(oBag)
End If


Check that the quote marks are correct - i.e. straight down ones rather than the curly sort!

C] Configure the Healthy/Unhealthy experssions as needed. Use the Parameter name:

Property[@Name='Status']

then enter the Value depenging on which way round you need things

 
 
D] Configure the alerting bit of the Monitor and you're all done

Thursday 14 August 2014

SCCM 2007 - Task Sequence Fails - Content Mismatch - 80091007


Symptom:
Task Sequence fails with 80091007 error code.

Cause:
This error indicates that the files on the DP for one of the packages referenced by your task sequence does not match the hash that was obtained when the package was imported. 

Fix:

The easiest way to see which part of your Task Sequence is causing the problem is to open the SCCM Console and go to Site Database > System Status > Advertisement Status > then find the advertisement status for the task sequence that failed.

In the details windows, right click on the Site name and choose 'Show Messages > All'.

This will show all the status messages for the Task Sequence advertisement from which you can spot what the problem is:




In the above screenshot we can see there is a content mismatch issue with the driver package.

As a result we need to get the hash values to match up. Easiest way to do this is to use the Manage Distribution Points Wizard to try refreshing the boot image package on all distribution points. Once this is done update the distribution points.

Be sure to "Refresh DPs" and then do "Update DPs". With a bit of luck this will have resolved the issue!




Sidenote:

Refresh Distribution Points: this forces the content to be redistributed to the distribution points.

Update Distribution Points: when you run this the DP will check the version number it has against the version number of the package on the site server. If they match up the DP will not perform the update