Jump to content

Services Status


Recommended Posts

Hi all,

I would like to check services status on the server such as zabbix_agent.exe, snmp.exe, vmware-authd.exe,...And, this is my code :

$ProcessName = "zabbix_agentd.exe"

If ProcessExists($ProcessName) Then

MsgBox(0,"Services Status",$ProcessName & " is running.")

Else

MsgBox(0,"Services Status",$ProcessName & " is not running.")

EndIf

I don't know how to do it in order to show all services in MsgBox ?

Please instruct me to this case.

Thanks !

Edited by KenzoIT
Link to comment
Share on other sites

Something like this maybe?

$processList = "explorer.exe,scite.exe,taskmgr.exe"
$aProcessList = StringSplit($processList, ',', 2)
$msgBoxString = ""

For $each In $aProcessList
    If ProcessExists($each) Then
        $msgBoxString &= $each & " is running." & @CRLF
    Else
        $msgBoxString &= $each & " is not running." & @CRLF
    EndIf
Next

MsgBox(0, "Service Status", $msgBoxString)
Edited by MrMitchell
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...