Hi guys
I'm working on custom inventory to collect the status of a Windows Services on a server. For example, I want to know if the status of the Windows Update services on a server. I would like to get a custom inventory to get this data, so I wrote this, but it's running sucessfully but the data is not showing up on the custom data class of the server. Any idea? also opened to do it on a easier way if there is. one.
Here is the script:
$nse = new-object -comobject Altiris.AeXNSEvent
$nse.priority = 1
$nse.To = "{1592B913-72F3-4C36-91D2-D4EDA21D2F96}"
#************************DO NOT EDIT********************************
#Modify this varaible with the custom data class guid
$objDCInstance = $nse.AddDataClass("{9a77ee87-eadf-4d18-a07b-04e31063c4aa}")
$objDataClass = $nse.AddDataBlock($objDCInstance)
$status = get-service wuauserv
$objDataRow = $objDataClass.AddRow()
$objDataRow.SetField(0, $status)
#Send the data
$nse.sendqueued()