我正在尝试使用我从下面的 php.net 遇到的 PHP 脚本连接到远程服务器 Win 2003,并返回错误 5,即权限,当我查询 localhost 时代码运行良好。
有没有人遇到过这个问题或知道解决方法?一旦我知道我可以连接,我计划监控服务,然后能够使用监控脚本重新启动它们。
$servicename ="crmskidata";
$machine ="crm2011";
//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>";