Re: why unable to enumerate services on one system??
- From: "Richard Mueller" <rlmueller-NOSPAM@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Mar 2006 12:33:12 -0600
Hi,
There is an extra "(" in your code, but I assume that's a typo. I also
assume the computers are running and that you can ping them. Otherwise, the
WMI connection will fail if DCOM is disabled. Also, I assume a firewall
could block WMI. Finally, I would make sure the WinMgmt service is running
on the machine. It's supposed to start automatically as needed, but who
knows.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
"Beemer Biker" <jstateson@xxxxxxxx> wrote in message
news:120blnq2qc4hb38@xxxxxxxxxxxxxxxxxxxxx
We have 4 systems, XP Pro, supposidly configured identical and on a
win2003
server lan
I have as script somewhat like this:
====list all sevices script===
..
set ObjDomain = GetObject("WinNT://myserver")
ObjDomain.Filter = Array("Computer")
for each ObjUser in ObjDomain
strout = ""
for each item in GetObject(("WINMGMTS://" &
ObjUser.name).ExecQuery("select * from win32_service")
strout = strout & item.name & vbcrlf
next
wscript.echo strout
next
Anyway, 3 of the 4 workstations plus the domain controller list their
services just fine. On one workstation I get the following error message:
"the remote server machine does not exist or is unavailable"
It does exist. I can log into it with my username (same as what ran the
script) and run the script on that system and it will enumerate all
workstations in addition to the server.
If I throw in a "on error resume next" then I get an empty strout printed
up
for that workstation. ie: the error message is masked
Why cant the script access that WINMGMTS on the workstation. Is there
some
"impersonate" mechanism needed? My username is on the domain and I am a
member of administrators, domain administrators and dns_admins If I can
run
the script correctly on that workstation, why cant I run the script on
another? For some reason that workstation does not want to enumerate its
services thru my script.
The entire purpose of this script is that I want to stop some services
copy
some files over updating the services, then restart the services.
Eventually there will be 40+ workstations. Is there a better way to
handle
this?
..thanks..
--
=======================================================================
Beemer Biker joestateson@xxxxxxxxxxxxx
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
=======================================================================
.
- Follow-Ups:
- Re: why unable to enumerate services on one system??
- From: Beemer Biker
- Re: why unable to enumerate services on one system??
- References:
- why unable to enumerate services on one system??
- From: Beemer Biker
- why unable to enumerate services on one system??
- Prev by Date: Remote Scripts
- Next by Date: Re: Scripting question
- Previous by thread: why unable to enumerate services on one system??
- Next by thread: Re: why unable to enumerate services on one system??
- Index(es):
Relevant Pages
|