Re: check remote computer name through it's IP
- From: Trevor Sullivan <pcgeek86@xxxxxxxxxxx>
- Date: Wed, 23 May 2007 04:47:01 -0500
Jeremy wrote:
You might also need admin privilege on the remote computer.
"Richard Mueller [MVP]" <rlmueller-nospam@xxxxxxxxxxxxxxxxxxxx> wrote in message news:uXQTA3NnHHA.596@xxxxxxxxxxxxxxxxxxxxxxxTo 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@xxxxxxxxxxxxxxxxThanks 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
--
He'd be receiving an access denied message if that were the case, but good thought.
Trevor Sullivan
MCP
http://develnet.blogspot.com
.
- References:
- Re: check remote computer name through it's IP
- From: Richard Mueller [MVP]
- Re: check remote computer name through it's IP
- From: Richard Mueller [MVP]
- Re: check remote computer name through it's IP
- From: Jeremy
- Re: check remote computer name through it's IP
- Prev by Date: Re: Sleep until any keystroke
- Next by Date: Re: vbScript on VISTA Problems?
- Previous by thread: Re: check remote computer name through it's IP
- Next by thread: Re: check remote computer name through it's IP
- Index(es):
Relevant Pages
|