VBScript to check if the SMS service is Installed

Recently I wsa asked how to check if SMS is installed, while there are many ways to do this, I wanted to look for the CCMExec service. This way if SMS is installed by its WMI classes are not there, we still get a true. Alternatives could be to look for the SMS WMI Classes or Add/Remove programs.

----Begin VBScript----
IF IsSMSInstalled = True Then

WScript.Echo "You have SMS Installed"
Else
WScript.Echo "SMS Service Not Found"
End If

Function IsSMSInstalled()
Dim oService

On Error Resume Next
Set oService = GetObject("winmgmts:root/cimv2:Win32_Service.Name='CcmExec'")
If Err = 0 Then IsSMSInstalled = True
On Error GoTo 0

Set oService = Nothing
End Function
----End VBScript----

Have a different way to check for SMS? Post a comment!

Comments

Unknown said…
This information is useful for me to work on Bulk sms this gives a reliable work for the people nice information.

Popular posts from this blog

SMS "Program failed (run time exceeded)" 10070

SMS "Waiting for User Condition" 10036

SMS "Waiting for content" 10035