# encoding: ascii
# api: powershell
# title: Detect SCCM 2007
# description: This is a VERY simple Powershell Function to test if the SCCM 2007 Agent is installed on a machine or not.
# version: 0.1
# type: function
# author: Sean Kearney
# license: CC0
# x-poshcode-id: 3555
# x-archived: 2012-08-04T23:31:51
# x-published: 2012-08-01T12:55:00
#
# All it actually does is return a Boolean True/False if the Agent is detected in a computer that is powered on.
# that’s all. It was useful for me, it might be useful for somebody else. Use is simple, run the Function and now you can use
# TEST-SCCMAgent -PC computername
#
function global:test-sccmagent {
param($PC)
[boolean]$result=get-wmiobject -Query "Select * from win32_service where Name = 'CcmExec'" -ComputerName $PC
return $result
}