|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Obtain info from other computerhi!
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. 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: Show quoteHide quote > 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. I'll try thanks.
Travis Sharpe wrote: Show quoteHide quote > 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.
array element isexist ?
How much disk space is needed... .Net and 32 processors Menus from a database table and addhandler System.OverflowException during IPostBackDataHandler.LoadPostData EDITITEMTEMPLATE FINDCONTROL PROBLEM Error Compiling Holding down keys II unhandled SecurityException in Visual Basic 2005 Express EDITITEMTEMPLATE FINDCONTROL PROBLEM |
|||||||||||||||||||||||