Re: why unable to enumerate services on one system??

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
=======================================================================




.



Relevant Pages

  • Re: Redirect computers to a specific OU by IP Address
    ... Getting the IP address of the workstation is easy if you are running the ... COMPLETELY lock them down until an admin put them into the right OU. ... I'm in the process of disabling computer accounts that have not been ... My biggest problem is that I just dont know where to start the script ...
    (microsoft.public.windows.server.active_directory)
  • Re: Redirect computers to a specific OU by IP Address
    ... Getting theIPaddress of the workstation is easy if you are running the ... script from the workstation. ... COMPLETELY lock them down until an admin put them into the rightOU. ... used for approx 180-240 days (as there is over 1000 computer accounts ...
    (microsoft.public.windows.server.active_directory)
  • Re: Me Too
    ... I did my testing of the script on my own XP ... Which could be tight on a server like SBS (though mine has never shown ... any service to take for a normal shutdown. ... this reg edit change made to a workstation would ...
    (microsoft.public.windows.server.sbs)
  • Re: Need to automate workstation tasks
    ... Microsoft Online Support ... |> workstation will be logged off unless the user performs some activity. ... | You would need to script that as you cannot trigger that by using Group ... | human solutions than taking several technical actions. ...
    (microsoft.public.windows.group_policy)
  • Re: Changing workstation Admin password through AD
    ... bouncing every member server and workstation monthly is not practical. ... GPO/startup script method... ... Windows Server MVP - Directory Services ... Change the password to the Administrator account ...
    (microsoft.public.win2000.active_directory)