note 91551 modified in function.win32-query-service-status by danbrown
| From: | danbrown@php.net | Date: | Tue, 16 Jun 2009 18:41:34 +0000 |
| Subject: | note 91551 modified in function.win32-query-service-status by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156937@lists.php.net to get a copy of this message | ||
***Notice the name is IISADMIN and not IIS Admin
right click the serivce then, type in the "Service Name" not the "Display Name"
or you will get 1060
<?php
$servicename ="IISADMIN";
$machine ="desktopper";
//print_r (win32_query_Service_status($servicename,$machine));
echo $servicename;
$sray = win32_query_Service_status($servicename,$machine);
echo "<br>";
print_r ($sray);
echo "<ul>";
echo "<li>Service Type: " .$sray[ServiceType] . "</li>";
echo "<li>CurrentState: " .$sray[CurrentState] . "</li>";
echo "<li>Controls Accpeted: " .$sray[ControlsAccepted] . "</li>";
echo "<li>Win32 Exit Code: " .$sray[Win32ExitCode] . "</li>";
echo "<li>Service Specific Exit Code: " .$sray[ServiceSpecificExitCode] .
"</li>";
echo "<li>Check Point: " .$sray[CheckPoint] . "</li>";
echo "<li>Wait Hint: " .$sray[WaitHint] . "</li>";
echo "<li>Process Id: " .$sray[ProcessId] . "</li>";
echo "<li>Service Flags: " .$sray[ServiceFlags] . "</li>";
?>
--was--
***Notice the name is IISADMIN and not IIS Admin
right click the serivce then, type in the "Service Name" not the "Display Name"
or you will get 1060
<?
$servicename ="IISADMIN";
$machine ="desktopper";
//print_r (win32_query_Service_status($servicename,$machine));
echo $servicename;
$sray = win32_query_Service_status($servicename,$machine);
echo "<br>";
print_r ($sray);
echo "<ul>";
echo "<li>Service Type: " .$sray[ServiceType] . "</li>";
echo "<li>CurrentState: " .$sray[CurrentState] . "</li>";
echo "<li>Controls Accpeted: " .$sray[ControlsAccepted] . "</li>";
echo "<li>Win32 Exit Code: " .$sray[Win32ExitCode] . "</li>";
echo "<li>Service Specific Exit Code: " .$sray[ServiceSpecificExitCode] .
"</li>";
echo "<li>Check Point: " .$sray[CheckPoint] . "</li>";
echo "<li>Wait Hint: " .$sray[WaitHint] . "</li>";
echo "<li>Process Id: " .$sray[ProcessId] . "</li>";
echo "<li>Service Flags: " .$sray[ServiceFlags] . "</li>";
?>
http://php.net/manual/en/function.win32-query-service-status.php