I'm a little confused on what exactly you are trying to check for the health status on, if it is the SMP Agent, here is a Powershell funciton I wrote to get the health status. I have other functions that then take various remediation steps based on the output here. I set my remediation script to run on each system in the domain via scheduled task I setup in Group Policy.
function Get-AltirisAgentHealth
{
#How many days we can accept policy to not have been updated.
$Cutoff = (Get-Date).AddDays(-20)
#Exit variables.
$Healthy = 'Healthy'
$NOGuid = 'NoGUID'
$OldPolicy = 'OldPolicy'
$NoAgent = 'NoAgent'
$NoPolicy = 'NoPolicy'
$BrokenCOM = 'BrokenCOM'
#Service Check
$AltirisService = Get-Service -Name AeXNSClient -ErrorAction SilentlyContinue
#Logging variables
$Timestamp = Get-Date -Format yyyy-MM-dd-hh-mm
$hostname = HOSTNAME.EXE
$ErrorNetworkLog = 'FileSystem::\\SomeServer\Logs\Errors\' + $hostname + '-' + $Timestamp + 'GetAltirisAgentHealthError' + '.txt'
try {
if ($AltirisService)
{
#Altiris COM object. Moved down here to prevent ugly errors if service doesn't exist.
$AltirisAgent = New-Object -ComObject Altiris.AexNSClient
if ($AltirisAgent.MachineGuid)
{
#GUID exists. Communication has happened at some point, let's see how long ago.
$LastPolicyString = $AltirisAgent.LastPolicyUpdate
if ($LastPolicyString)
{
#Converting string to object date time. Shouldn't throw an exception since we verified string exists.
$LastPolicyObject = [datetime]"$LastPolicyString"
if ($LastPolicyObject -lt $Cutoff)
{
#Agent has not received updated policy recently.
$OldPolicy
}
else
{
#Agent health appears good.
$Healthy
}
}
else
{
#No policy ever pulled down.
$NoPolicy
}
}
else
{
#No GUID means no communication.
$NOGuid
}
}
else
{
#Agent not found.
$NoAgent
}
}
Catch
{
$ErrorMessage = $_.Exception.Message
"$hostname unable to Get Altiris Agent Health at $Timestamp due to $ErrorMessage" | Out-File -FilePath $ErrorNetworkLog
$BrokenCOM
}
}