Works perfectly well, as soon as you remember that perl IS Case
Sensitive and win32::lanman is NOT the same as Win32::Lanman...

Fix the "use win32::lanman" line and try again to see all your services
(and don't forget changing "\\\\MyServerNameHere"... :))

HTH,
  Fernando Madruga
 
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Jahsman Dan L
Sent: ter�a-feira, 11 de Junho de 2002 21:23
To: 'Perl-Win32-Admin (E-mail)
Subject: RE: Win32::Service::GetStatus


Good Day All, 
I have been tring to Enum Services on a server with one of the standard
examples from lanman.html listed here 
        use win32::lanman; 
         if(!Win32::Lanman::EnumServicesStatus("\\\\MyServerNameHere",
"", &SERVICE_WIN32, &SERVICE_STATE_ALL, \@services)) 
        { 
                print "Sorry, something went wrong; error: "; 
                # get the error code 
                print Win32::Lanman::GetLastError(); 
                exit 1; 
         } 
         foreach $service (@services) 
         { 
                print "${$service}{name}\n"; 
                foreach $key (sort keys %$service) 
                { 
                        print "\t$key = ${$service}{$key}\n" 
                                if $key ne 'name'; 
                } 
         } 
and I receive the following error 
        Undefined subroutine &main::SERVICE_WIN32 called at
findallservices.pl line 3. 
Can anyone tell me what is going wrong here? 
Thanks, 
dan 
-----Original Message----- 
From: Chuck Lawhorn [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 01, 2002 9:38 PM 
To: John Serink; 'Perl-Win32-Admin (E-mail) 
Subject: RE: Win32::Service::GetStatus 


I use the Win32::Lanman module, and get service status using the
EnumServicesStatus command. It 
doesn't have the same problem as the Win32::Service module. 
Hope this helps, 
--Chuck 
--- John Serink <[EMAIL PROTECTED]> wrote: 
> I was using that module about 6 months back and wrote this in my daily
log: 
> "There is a bug in the Win32::Service::GetStatus function. If the
service is 
> not running, its type is not reported. Basically, the only thing the 
> Win32::Service::GetStatus function is good for is to find if the
service is 
> running or not. Any other information must be garnered by directly
reading 
> the registry." 
> 
> I ending up just reading the registry as that was appropriate for my
app. 
> Else, you can make sure the NT resource kit is installed and parse the

> response of the "sc \\hostname query servicename" command. 
> 
> Cheers, 
> john 


__________________________________________________ 
Do You Yahoo!? 
Yahoo! Health - your guide to health and wellness 
http://health.yahoo.com 
_______________________________________________ 
Perl-Win32-Admin mailing list 
[EMAIL PROTECTED] 
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs 

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to