Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Friday, November 9, 2012

BGInfo Useful Custom Strings

Recently I have been using BGInfo a bit more to get a better handle on what servers I am currently working on. Most of the time the standard definitions work well enough, but there are the few occasions when I want to show additional details or to hide information.

One such case that has come up often is when a server has multiple NICs, but only one is in use. BGInfo by default show all, so you have to add custom WMI queries to show only the info you want. I found a site that listed several useful queries as follows:

  • Active DNS - WMI Query - SELECT DNSServerSearchOrder FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active IP - WMI Query - SELECT IPAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active MAC Address - WMI Query - SELECT MACAddress FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Active Subnet Mask - WMI Query - SELECT IPSubnet FROM Win32_NetworkAdapterConfiguration where IPEnabled = 'True'
  • Manufacturer - WMI Query - SELECT Manufacturer FROM Win32_ComputerSystem
  • Model - WMI Query - SELECT Model FROM Win32_ComputerSystem
  • OS and Edition - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName
  • OS Architecture - WMI Query - SELECT OSArchitecture FROM Win32_OperatingSystem
  • OS Architecture XP2K3 - Registry Value - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE
  • Workgroup - WMI Query - SELECT Workgroup FROM Win32_ComputerSystem

I also added one of my own to show the IIS version on the desktop:
  • IIS Version - Registry Value - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\SetupString
Using these in combination with the predefined queries has allowed me to display all relevant information that I want.  

Friday, August 3, 2012

Ghost Network Interface Cards

Recently, I imported a bunch of virtual machines.  After the import was complete, only one nic showed up under network adapters but when making any changes to the static IP's a warning was shown stating duplicate information.  After doing some digging, I found that there were actually 2 NICs in the system, but only one was being display.   I tried multiple ways to get the second card removed, but had no success until I came across a few posts mentioning devcon.

Using devcon you can perform the following command line options to remove the ghosted nic:

  • Run this command to list all the network hardware
    •  devcon findall =net  
  • This will output a bunch of information in the format PCI\VEN_xxxxx : Adapter Name
  • Copy the string before the colon.
  • Run the devcon command to remove the nic
    • devcon -r remove "@PCI\Ven_xxxxxx"


The biggest issue I ran into was getting devcon for the correct architecture.  The inital post I read linked to Microsoft for the x86 and ia64, but my systems were running x64.  So, I managed to find the tool on a Windows Server installation media for x64.  But I have also found it online as part of the Windows Driver Kit with instruction on how to extract it here How to Obtain the Current Version of Device Console Utility (DevCon.exe)

Thursday, March 8, 2012

DHCP Information

I came across a recent little command that helped me out a lot.  I was trying to determine all of the information of a DHCP server that had multiple reservations.  Now, I could use the management console and just export the IP and reservation name.  But this did not give me the MAC addresses or any additional information.  I also wanted to just have the basic info of the DHCP scope.  So, after some searching I found a fairly easy way to do it.  I ran the command:

netsh dhcp server dump >> C:\DHCP_Info.txt

This created a file DHCP_Info.txt in the root drive that contained all the information i needed.  I just had to parse the section that listed reservations and import it into a table.