Discussion:
Remote connection issue using GetObject("winmgmts:\\" ...
(too old to reply)
Jaisol
2007-08-10 21:47:45 UTC
Permalink
Hi,

For unknown reason I can't connect any server remotely via
GetObject("winmgmts:\\" & strComputer & ...) but I can connect them using
GetObject("IIS://" & strComputer & "/w3svc") with success.

I got Microsoft VBScript runtime error: The remote server machine does not
exist or is unavailable: 'GetObject' when I use the first method but not
when I use the second one....so, what is the difference?

I tried to connect using CreateObject("WbemScripting.SWbemLocator") but it
didn't work. In this case I got SWbemLocator: The RPC server is unavailable.

Can I use another method to connect remotely like GetObject("IIS://" &
strComputer & "/w3svc")?

How can I resolve that?


Thanks a lot,
Jaisol
Michael Harris (MVP)
2007-08-10 23:39:45 UTC
Permalink
Post by Jaisol
Hi,
For unknown reason I can't connect any server remotely via
GetObject("winmgmts:\\" & strComputer & ...) but I can connect them
Try it with... "winmgmts://"
Post by Jaisol
using GetObject("IIS://" & strComputer & "/w3svc") with success.
I got Microsoft VBScript runtime error: The remote server machine
does not exist or is unavailable: 'GetObject' when I use the first
method but not when I use the second one....so, what is the
difference?
I tried to connect using CreateObject("WbemScripting.SWbemLocator")
but it didn't work. In this case I got SWbemLocator: The RPC server
is unavailable.
Can I use another method to connect remotely like GetObject("IIS://" &
strComputer & "/w3svc")?
How can I resolve that?
Thanks a lot,
Jaisol
--
Michael Harris
MVP - Admin Frameworks
Michael Harris (MVP)
2007-08-10 23:48:53 UTC
Permalink
Post by Michael Harris (MVP)
Post by Jaisol
Hi,
For unknown reason I can't connect any server remotely via
GetObject("winmgmts:\\" & strComputer & ...) but I can connect them
Try it with... "winmgmts://"
Never mind...\\ vs. // doesn't seem to matter.
Post by Michael Harris (MVP)
Post by Jaisol
using GetObject("IIS://" & strComputer & "/w3svc") with success.
I got Microsoft VBScript runtime error: The remote server machine
does not exist or is unavailable: 'GetObject' when I use the first
method but not when I use the second one....so, what is the
difference?
I tried to connect using CreateObject("WbemScripting.SWbemLocator")
but it didn't work. In this case I got SWbemLocator: The RPC server
is unavailable.
Can I use another method to connect remotely like GetObject("IIS://"
& strComputer & "/w3svc")?
How can I resolve that?
Thanks a lot,
Jaisol
--
Michael Harris
MVP - Admin Frameworks
Jaisol
2007-08-11 14:05:26 UTC
Permalink
Well...I forgot something....all remote machines are servers with windows
2003 enterprise edition sp1 and they are distributed in 3 environments:
development, pre-production and production.
I'm getting error just from production servers however I'm sure those
machines have WMI installed and it is working perfectly on each because I
can do everything locally (using strComputer = ".") with WMI.

I'm part of administrators group on production servers as I'm in others
(development and pre-prod) then I suppose I have permissions required. Is
that correct or not?

Something else, I can connect with success to production servers using
GetObject("IIS://" & strComputer & "/w3svc"), I always thought it's WMI. Is
it WMI or not?

Maybe some special configuration is taked on production servers. Can WMI
allow special configuration? How can I verify it if it is? Or should I look
on other window configuration?

Thanks again,
Jaisol

---
Post by Michael Harris (MVP)
Post by Michael Harris (MVP)
Post by Jaisol
Hi,
For unknown reason I can't connect any server remotely via
GetObject("winmgmts:\\" & strComputer & ...) but I can connect them
Try it with... "winmgmts://"
Never mind...\\ vs. // doesn't seem to matter.
Post by Michael Harris (MVP)
Post by Jaisol
using GetObject("IIS://" & strComputer & "/w3svc") with success.
I got Microsoft VBScript runtime error: The remote server machine
does not exist or is unavailable: 'GetObject' when I use the first
method but not when I use the second one....so, what is the
difference?
I tried to connect using CreateObject("WbemScripting.SWbemLocator")
but it didn't work. In this case I got SWbemLocator: The RPC server
is unavailable.
Can I use another method to connect remotely like GetObject("IIS://"
& strComputer & "/w3svc")?
How can I resolve that?
Thanks a lot,
Jaisol
--
Michael Harris
MVP - Admin Frameworks
Richard Mueller [MVP]
2007-08-11 01:32:16 UTC
Permalink
Post by Jaisol
For unknown reason I can't connect any server remotely via
GetObject("winmgmts:\\" & strComputer & ...) but I can connect them using
GetObject("IIS://" & strComputer & "/w3svc") with success.
I got Microsoft VBScript runtime error: The remote server machine does not
exist or is unavailable: 'GetObject' when I use the first method but not
when I use the second one....so, what is the difference?
I tried to connect using CreateObject("WbemScripting.SWbemLocator") but it
didn't work. In this case I got SWbemLocator: The RPC server is unavailable.
Can I use another method to connect remotely like GetObject("IIS://" &
strComputer & "/w3svc")?
For best results with all OS combinations I use:

Set m_WMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
& strComputer & "\root\cimv2")


If this doesn't work, either the remote computer doesn't have WMI installed,
you lack permissions, WMI is blocked, or WMI is corrupted. Sometimes you can
fix things by stopping and starting the WMI service on the remote computer.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
Jaisol
2007-08-11 14:04:59 UTC
Permalink
Well...I forgot something....all remote machines are servers with windows
2003 enterprise edition sp1 and they are distributed in 3 environments:
development, pre-production and production.
I'm getting error just from production servers however I'm sure those
machines have WMI installed and it is working perfectly on each because I
can do everything locally (using strComputer = ".") with WMI.
I've tested your advice and it didn't work :-(

I'm part of administrators group on production servers as I'm in others
(development and pre-prod) then I suppose I have permissions required. Is
that correct or not?

Something else, I can connect with success to production servers using
GetObject("IIS://" & strComputer & "/w3svc"), I always thought it's WMI. Is
it WMI or not?

Maybe some special configuration is taked on production servers. Can WMI
allow special configuration? How can I verify it if it is? Or should I look
on other window configuration?

Thanks again,
Jaisol

---
Post by Richard Mueller [MVP]
Post by Jaisol
For unknown reason I can't connect any server remotely via
GetObject("winmgmts:\\" & strComputer & ...) but I can connect them using
GetObject("IIS://" & strComputer & "/w3svc") with success.
I got Microsoft VBScript runtime error: The remote server machine does
not exist or is unavailable: 'GetObject' when I use the first method but
not when I use the second one....so, what is the difference?
I tried to connect using CreateObject("WbemScripting.SWbemLocator") but
it didn't work. In this case I got SWbemLocator: The RPC server is
unavailable.
Can I use another method to connect remotely like GetObject("IIS://" &
strComputer & "/w3svc")?
Set m_WMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" _
& strComputer & "\root\cimv2")
If this doesn't work, either the remote computer doesn't have WMI
installed, you lack permissions, WMI is blocked, or WMI is corrupted.
Sometimes you can fix things by stopping and starting the WMI service on
the remote computer.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
TDM
2007-08-15 21:28:01 UTC
Permalink
Post by Richard Mueller [MVP]
If this doesn't work, either the remote computer doesn't have WMI
installed, you lack permissions, WMI is blocked, or WMI is corrupted.
Sometimes you can fix things by stopping and starting the WMI service on
the remote computer.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
Not to mention that WMI will not get through the Windows Firewall, BOTH
systems
must have the firewall turned off for WMI to connect to remote hosts.

TDM
Richard Mueller [MVP]
2007-08-15 21:53:35 UTC
Permalink
Post by TDM
Post by Richard Mueller [MVP]
If this doesn't work, either the remote computer doesn't have WMI
installed, you lack permissions, WMI is blocked, or WMI is corrupted.
Sometimes you can fix things by stopping and starting the WMI service on
the remote computer.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
Not to mention that WMI will not get through the Windows Firewall, BOTH
systems
must have the firewall turned off for WMI to connect to remote hosts.
TDM
Also, an excellent article on troubleshooting WMI:

http://www.microsoft.com/technet/scriptcenter/topics/help/wmi.mspx

Regarding firewalls, I paste this from the link:
A firewall is blocking access to the remote computer. WMI uses the DCOM
(Distributed COM) and RPC (Remote Procedure Call) protocols to traverse the
network. By default, many firewalls block DCOM and RPC traffic; if your
firewall is blocking these protocols then your script will fail. For
example, the Windows Firewall found in Microsoft Windows XP Service Pack 2
is configured to automatically block all unsolicited network traffic,
including DCOM and WMI: in its default configuration, the Windows Firewall
will reject an incoming WMI request and give you a “Remote server machine
does not exist or is unavailable” error

If you are sure that a computer is online and you know that you have local
administrator rights on that computer, then problems getting past a firewall
often explain why your script is failing. We can’t tell you how to configure
your firewall to permit DCOM and RPC traffic; that obviously depends on the
type of firewall you have. However, if you suspect that the Windows Firewall
is to blame you can find information about managing and configuring the
firewall settings in the article I Married Bigfoot! Oh, and Windows Service
Pack 2 Made My Computer Disappear. The WMI SDK also has additional
information about connecting to the WMI service through the Windows
firewall.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
Richard Mueller [MVP]
2007-08-15 22:56:21 UTC
Permalink
Post by Richard Mueller [MVP]
Post by TDM
Post by Richard Mueller [MVP]
If this doesn't work, either the remote computer doesn't have WMI
installed, you lack permissions, WMI is blocked, or WMI is corrupted.
Sometimes you can fix things by stopping and starting the WMI service on
the remote computer.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
Not to mention that WMI will not get through the Windows Firewall, BOTH
systems
must have the firewall turned off for WMI to connect to remote hosts.
TDM
http://www.microsoft.com/technet/scriptcenter/topics/help/wmi.mspx
A firewall is blocking access to the remote computer. WMI uses the DCOM
(Distributed COM) and RPC (Remote Procedure Call) protocols to traverse
the network. By default, many firewalls block DCOM and RPC traffic; if
your firewall is blocking these protocols then your script will fail. For
example, the Windows Firewall found in Microsoft Windows XP Service Pack 2
is configured to automatically block all unsolicited network traffic,
including DCOM and WMI: in its default configuration, the Windows Firewall
will reject an incoming WMI request and give you a “Remote server machine
does not exist or is unavailable” error
If you are sure that a computer is online and you know that you have local
administrator rights on that computer, then problems getting past a
firewall often explain why your script is failing. We can’t tell you how
to configure your firewall to permit DCOM and RPC traffic; that obviously
depends on the type of firewall you have. However, if you suspect that the
Windows Firewall is to blame you can find information about managing and
configuring the firewall settings in the article I Married Bigfoot! Oh,
and Windows Service Pack 2 Made My Computer Disappear. The WMI SDK also
has additional information about connecting to the WMI service through the
Windows firewall.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
That "Bigfoot" link above didn't paste like I thought. Here is the link:

http://www.microsoft.com/technet/scriptcenter/resources/tales/sg1104.mspx#EYC
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--
Loading...