473,395 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Obtain info from other computer

hi!
I'm trying to get some info from other computers, I make ping to test that
are powered on, then want to get netbios name and MAC. I get the dns name
and get only first part as netbios (although this may be wrong,right?).
Is there anyway to get netbios and mac of other computer?
Thanks.
Jul 20 '06 #1
2 1791
You could use WMI to collect the information you want from a remote
machine. Look at the System.Management classes, and the
Win32_NetworkAdapterConfiguration WMI class.

Here's an example of a VBScript that does something simliar, it's not
too difficult to port this to VB.NET with the classes in System.Managment

---------------------------------------------------------
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

strComputer = INputbox("Enter an IP address or ComputerName")

WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_NetworkAdapterConfiguration", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "DatabasePath: " & objItem.DatabasePath
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DNSDomain: " & objItem.DNSDomain
WScript.Echo "DNSHostName: " & objItem.DNSHostName
strIPAddress = Join(objItem.IPAddress, ",")
WScript.Echo "IPAddress: " & strIPAddress
WScript.Echo "MACAddress: " & objItem.MACAddress
WScript.Echo "TcpipNetbiosOptions: " & objItem.TcpipNetbiosOptions
Wscript.echo "----------------------------------------------------"
Next
--------------------------------------------------------------------

XiScO wrote:
hi!
I'm trying to get some info from other computers, I make ping to test that
are powered on, then want to get netbios name and MAC. I get the dns name
and get only first part as netbios (although this may be wrong,right?).
Is there anyway to get netbios and mac of other computer?
Thanks.
Jul 20 '06 #2
I'll try thanks.

Travis Sharpe wrote:
You could use WMI to collect the information you want from a remote
machine. Look at the System.Management classes, and the
Win32_NetworkAdapterConfiguration WMI class.

Here's an example of a VBScript that does something simliar, it's not
too difficult to port this to VB.NET with the classes in System.Managment

---------------------------------------------------------
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

strComputer = INputbox("Enter an IP address or ComputerName")

WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM
Win32_NetworkAdapterConfiguration", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objItem In colItems
WScript.Echo "Caption: " & objItem.Caption
WScript.Echo "DatabasePath: " & objItem.DatabasePath
WScript.Echo "Description: " & objItem.Description
WScript.Echo "DNSDomain: " & objItem.DNSDomain
WScript.Echo "DNSHostName: " & objItem.DNSHostName
strIPAddress = Join(objItem.IPAddress, ",")
WScript.Echo "IPAddress: " & strIPAddress
WScript.Echo "MACAddress: " & objItem.MACAddress
WScript.Echo "TcpipNetbiosOptions: " & objItem.TcpipNetbiosOptions
Wscript.echo "----------------------------------------------------"
Next
--------------------------------------------------------------------

XiScO wrote:
>hi!
I'm trying to get some info from other computers, I make ping to test
that are powered on, then want to get netbios name and MAC. I get the dns
name and get only first part as netbios (although this may be
wrong,right?). Is there anyway to get netbios and mac of other computer?
Thanks.
Jul 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mats | last post by:
Hi! I have a Windows 2000 computer (let's call it Comp1) that is used as a web server and i have an other computer (Comp2) that has a filebased access-database. How can i through ASP from...
2
by: alex002 | last post by:
Dear all, I would like to know how can I send some messages to other computers in the intranet so that other computer can suddenly show the messages in the pop up window? Thank you for all of...
3
by: John M | last post by:
Hello, I have problem when copying the sln application to other computer. The project is on directory phones. The other computer cannot even open the application : doesn't find the...
1
by: joe | last post by:
if i copy the solution and the project file from my computer to other computer. it can't open why? and how to modify the file that can open in anywhere
9
by: sirimanna | last post by:
sir, Is any one can help me to teach how to see a other computer desktop using networking...i have 15 computer's in my office..i want to see other's computer through networking... please tell...
0
by: adnanahmed714 | last post by:
Hi Experts! i made a application for plant monitoring.Can some one help me , to access(Run+ Monitor) VB application from other Computer on the Network. I just want to monitor the forms on the...
3
by: Boki | last post by:
Hi All, I have finished my first version of program, I use "build" to create BokiProgram.exe I copy this file from bin\release\ I copy it to my desktop folder, it works. I copy this file to...
0
by: aceprahmatkosim | last post by:
I have problem connection database, PHP to MsAccess via ODBC but the DSN place in other computer. How I can do that? $user = "connect"; $password = "pwdmdb"; $dataku =...
1
by: vabh | last post by:
Hello, My computer is connected in LAN and so many other computers too. So, now i want to access any .exe file of any other computer. Before that i am accessing the Computer Name and IPAddress...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.