Re: check remote computer name through it's IP

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You might also need admin privilege on the remote computer.

"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx> wrote in message news:uXQTA3NnHHA.596@xxxxxxxxxxxxxxxxxxxxxxx
To handle as many situations as possible, try:

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

Otherwise, either the remote computer (or your computer) does not have WMI installed (older than Windows 2000), WMI is corrupt, or WMI is blocked by a firewall. Of course, this assumes the remote computer is online and you have connectivity, which should be the case if you can ping it.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--

"Golden_au" <Goldenau@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:7408BB90-EC4E-4A00-8DBA-79FCBDF48ED2@xxxxxxxxxxxxxxxx
Thanks Jeremy and Richard, your scripts iare very helpfull, but my request is
a bit more, I need to retry the remote computer name. but maybe it is the
firwall issue, I got error on Jeremy's script regarding "The remote server
machine does not exist or is unavailable:'GetObject'. is their anyway to
overcome this issue?
--
Golden_au


"Richard Mueller [MVP]" wrote:

Golden_au wrote:

> Is there anyway to check remote computer name if I only know the ip
> address
> by vbscript.

I link three VBScript programs that ping remote computers to see if they
respond on this page:

http://www.rlmueller.net/PingComputers.htm

You normally ping by computer NetBIOS name, but you can also ping by IP
address with all three. The one you select depends on your OS and WSH
version. However, they will not return the NetBIOS name of the computer,
only that they are available. The code posted previously using WMI is
probably the best way to retrieve the name. However, if the computer is not
available (turned on and authenticated to the domain, no need for a user to
be logged on), there will be a timeout. The WMI timeout, which is several
seconds, can be avoided by first pinging the computer and only attempting to
connect with WMI if the machine responds. Also, note that only computers
with Windows 2000 will have WMI installed by default.

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--






.



Relevant Pages

  • RE: Attempting to use VBA to Ping within Excel...
    ... Win32_PingStatus was added for windows XP. ... I am attempting to ping a list of machine names listed within Excel 2003. ... WMI service on remote computers, and if it is available gets ... 11003 Destination Host Unreachable ...
    (microsoft.public.excel.programming)
  • Re: Online Test
    ... Using ping seem to be a rather crude way. ... > Almost any method for communicating with a remote computer is going to have ... > WMI script to determine that a system is not there. ... torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway ...
    (microsoft.public.scripting.vbscript)
  • Re: Connect by WMI to a remote stand-alone computer(doesnt belong to any domain)
    ... I read that WMI needs at least 135 and 445 ports open but these ports have ... "Connecting to WMI on a Remote Computer" ... My first task is to make the connection to work. ...
    (microsoft.public.win32.programmer.wmi)
  • Re: check remote computer name through its IP
    ... either the remote computer does not have WMI ... I link three VBScript programs that ping remote computers to see if they ... with Windows 2000 will have WMI installed by default. ...
    (microsoft.public.scripting.vbscript)
  • Re: Error 800A0046 while running a vbs script on a remote computer
    ... do I need administrator rights? ... Windows 2000 and I just ran the script on a Windows 2000 and it works. ... Microsoft MVP Scripting and ADSI ... You need administrative rights on the remote computer. ...
    (microsoft.public.scripting.vbscript)