Hi,
I have tried many scripts at my local machine. It gave pop up when service for one particular application went down. But the same thing is not happening for the remote computer. Please look at the script below:
strComputer = "."
Set objFirewall = CreateObject("HNetCfg.FwMgr")
Set objPolicy = objFirewall.LocalPolicy.CurrentProfile
objPolicy.FirewallEnabled = FALSE
Set objAdminSettings = objPolicy.RemoteAdminSettings
objAdminSettings.Enabled = TRUE
Set oWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!" & sComputerName& "rootcimv2")
Set colRunningServices = oWMIService.ExecQuery _
("SELECT * FROM Win32_Service)
For Each oService in colRunningServices
Wscript.Echo oService.DisplayName & VbTab & oService.State
Next
I have tried without the firewal and admin rights settings as well in the above code and giving the IP address of the remote computer in strcomputer="IP Address"
It doesn't work. Could you please help me out in knowing the problem with the above or give me some code which can do the purpose.
Awaiting eagerly for your response.
Many Thanks.
Naaz.
Software/Hardware used:
ASKED:
April 18, 2008 12:24 PM
UPDATED:
April 22, 2008 3:44 PM
Be sure and check out my blog here on ITKE for more Network administration and VBSCRIPT tips.
The VBScript Network and Systems Administrator’s Cafe
Hi Jlees,
Thanks for your help on this.
But i get error message as “There are no more endpoints available from the endpoint mapper.”
Also, it would be great of you if you can give modified code that can tell me the status of service on a remote computer but not on a local computer.
Thanks much in advance. But m very much in need of your answer on this. Please reply to this asap.
Regs,
Naaz.