Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

winmgmts over WAN connect issue

Status
Not open for further replies.

Entropy01

Technical User
Nov 24, 2010
1
US
Hey guys I'm having a funny issue using winmgmts...we have a VPN connecting multiple physical locations. One method of connecting to remote machines works for machines local to the location the script is running from and the other method works for machines local to locations elsewhere.

Method 1:
'~ works for machines local to the network the script runs from
Set objWMIService = GetObject("Winmgmts:{impersonationLevel=impersonate,authenticationLevel=Pkt,authority=ntlmdomain:domain.com}!//" & strComputer & "\root\cimv2")

Method 2:
'~ works for machines outside the network the machine the script runs on
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, "root\cimv2",,,,"ntlmdomain:domain")
objWMIService.Security_.ImpersonationLevel = 3


Any thoughts on why this may be the case?

The error I seem to get in both scenarios references the RPC server being unavailable, however its the same all the time, I think it might be misleading.
 
the second method you are not setting an authenticationLevel like you are in the first method

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top