Hi Brotherens I need to obtain a list of service on a remote machine that have not started. I Used this code below
$|++; use strict; use diagnostics; use Win32::Service; use vars qw/$machine %SSvcLst/; $machine = "\\\\". $ARGV[0]; if (Win32::Service::GetServices($machine,\ %SSvcLst)) { print "\nObtaining list of running services\n"; for my $item (sort ( keys ( %SSvcLst ))) { print "$SSvcLst{$item} = $item\n"; if (Win32::Service::GetStatus($machine ,$SSvcLst{$item},\ my +%status)) { for my $item2 (keys ( %status)) { print "\t\t$item2 = $status{$item2}\n"; } } } }
and the out put that I got is:
Obtaining list of running services Alerter = Alerter CurrentState = 4 ServiceType = 32 CheckPoint = 0 ServiceSpecificExitCode = 0 WaitHint = 0 Win32ExitCode = 0 ControlsAccepted = 1 SeagateAgentBrowser = Backup Exec (TM) 7.0 Agent Browser CurrentState = 4 ServiceType = 16 CheckPoint = 0 ServiceSpecificExitCode = 0 WaitHint = 0 Win32ExitCode = 0 ControlsAccepted = 1 Seagate Alert Server = Backup Exec (TM) 7.0 Alert Server CurrentState = 4 ServiceType = 16 CheckPoint = 0 ServiceSpecificExitCode = 0 WaitHint = 0 Win32ExitCode = 0 ControlsAccepted = 1 Seagate Device & Media Service = Backup Exec (TM) 7.0 Device & Media S +ervice CurrentState = 4 ServiceType = 16 CheckPoint = 0 ServiceSpecificExitCode = 0 WaitHint = 0 Win32ExitCode = 0 ControlsAccepted = 5 Seagate Job Engine = Backup Exec (TM) 7.0 Job Engine CurrentState = 4 ServiceType = 16 CheckPoint = 0 ServiceSpecificExitCode = 0 WaitHint = 0 Win32ExitCode = 0 ControlsAccepted = 5
I assume that the current status is what I am after, however the out put is just an Integer,...can some please tell me what are those numbers equate to?

In reply to Remote NT services by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.