Hi guys,
I would like to retrieve the computer name on a whole lot of pcs. The
problem is I cannot use a networking object to retrieve it because some of
the pcs have their network card disabled. I work in retail as a pos support
guy, and we get info from the stores pcs through dialup.
Is there any way to get the host name or computer name of these machines
without doing a query to a network adapter?
Any help greatly appreciated.
I have tried the following:
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled =
True")
For Each objAdapter in colAdapters
Wscript.Echo "Host name: " & objAdapter.DNSHostName
Next
This works for a pc which has their network adapter card enabled, but even
if I change it to FALSE, for disabled card, it does not return it.
Simon
--
---------------------------------------------------------------------
"Are you still wasting your time with spam?...
There is a solution!"
Protected by GIANT Company's Spam Inspector
The most powerful anti-spam software available.
http://mail.spaminspector.com