The server name should be preceded with \\.  However, in a Perl string the
backslashes must be doubled.  That is, "\\\\hotnt006".

The service name should be the short name rather than the usually longer
descriptive name.  Counter-intuitively, for the service you are querying,
"Server" is the descriptive name and "LanmanServer" is the short name.

Below is the output from a Perl script that uses Win32::Service to display
the current status of every service installed on a WinNT 4.0 workstation.
The name to the right of the colon is the short name.  The name in
parentheses is the descriptive name.

Stopped: Alerter (Alerter)
Running: AvSynMgr (AVSync Manager)
Running: Browser (Computer Browser)
Stopped: ClipSrv (ClipBook Server)
Stopped: DHCP (DHCP Client)
Running: EventLog (EventLog)
Stopped: EventSystem (COM+ Event System)
Running: LanmanServer (Server)
Running: LanmanWorkstation (Workstation)
Running: LmHosts (TCP/IP NetBIOS Helper)
Running: McShield (McShield)
Running: Messenger (Messenger)
Stopped: mnmsrvc (NetMeeting Remote Desktop Sharing)
Stopped: MSIServer (Windows Installer)
Stopped: NetDDE (Network DDE)
Stopped: NetDDEdsdm (Network DDE DSDM)
Running: Netlogon (Net Logon)
Stopped: nmagent (Network Monitor Agent)
Running: NtLmSsp (NT LM Security Support Provider)
Stopped: PerlSock (Perl Socket Service)
Running: PlugPlay (Plug and Play)
Running: ProtectedStorage (Protected Storage)
Running: RasAuto (Remote Access Autodial Manager)
Running: RasMan (Remote Access Connection Manager)
Stopped: RemoteAccess (Remote Access Server)
Stopped: Replicator (Directory Replicator)
Stopped: RPCLOCATOR (Remote Procedure Call (RPC) Locator)
Running: RpcSs (Remote Procedure Call (RPC) Service)
Running: Schedule (Task Scheduler)
Stopped: SENS (System Event Notification)
Running: Spooler (Spooler)
Running: TapiSrv (Telephony Service)
Stopped: UPS (UPS)
Running: WinMgmt (Windows Management Instrumentation)

Gary

-----Original Message-----
From: Veeraraju_Mareddi [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 08, 2001 4:18 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Win32::Service


Dear Team

I am trying to check a service on a remote machine using Win32::Service. But
it is telling  "No such file or directorySuccess".

The script is given below Please look in to it.. 

Service.pl
use Win32::Service;

if (Win32::Service::GetStatus("hotnt006", "Server", \%status) ==0)
{ print "Failed :$!";
}
print "Success";

foreach $key( %status)
{
print "$key is $status{$key} \n";

}


Thanx And Regards
Raju
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin

Reply via email to