User Tools

Site Tools


virtualization:microsoft:hyper-v-nic

This is an old revision of the document!


Configuring Hyper-V Network Interfaces

Get-NICInformation.ps1

# ---------------------------------------------------------------------------------------------- #
# Powershell Get-NICInformation $Rev: 748 $                                                                 
# (c) 2011 Thomas Maurer. All rights reserved.                                              
# created by Thomas Maurer 
# www.thomasmaurer.ch
# www.itnetx.ch                                                                 
# last Update by $Author: tmaurer $ on $Date: 2012-02-24 14:07:36 +0100 (Fr, 24 Feb 2012) $     
# ---------------------------------------------------------------------------------------------- #
 
 
#region [INFO BLOCK]
# INFO
Write-Host "                               " -BackgroundColor Black -ForegroundColor White
Write-Host " PowerShell Get-NICInformation " -BackgroundColor Black -ForegroundColor White
Write-Host "                               " -BackgroundColor Black -ForegroundColor White
Write-Host " by Thomas Maurer              " -BackgroundColor Black -ForegroundColor White
Write-Host " www.thomasmaurer.ch           " -BackgroundColor Black -ForegroundColor White
Write-Host "                               " -BackgroundColor Black -ForegroundColor White
#endregion
 
$adapters = Get-WMIObject Win32_PNPSignedDriver | Where-Object { $_.DeviceClass -eq “NET” -and $_.HardWareID -like “*PCI*” } | Sort-Object location
  
foreach ($adapter in $adapters ) {
  
    $adapterName = Get-WMIObject Win32_NetworkAdapter | Where-Object { $_.PNPDeviceID -eq $adapter.DeviceID }
    $adapterConfiguration = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object { $_.index -eq $adapterName.Index }
  
    Write-Host ‘Adapter Name :’ $adapterName.NetConnectionID
    Write-Host ‘PCI BUS :’ $adapter.Location
    Write-Host ‘MAC Address :’ $adapterName.MACAddress
    Write-Host ‘GUID :’ $adapterName.GUID
    Write-Host ‘Adpater Index :’ $adapterName.Index
    Write-Host ‘Hardwarename :’ $adapterName.Name
    Write-Host ‘DHCP enabled :’ $adapterConfiguration.DHCPEnabled
    Write-Host ‘IP Address :’ $adapterConfiguration.IPAddress
    Write-Host ‘Subent :’ $adapterConfiguration.IPSubnet
    Write-Host ‘Default Gateway :’ $adapterConfiguration.DefaultIPGateway
    Write-Host  
  
}
virtualization/microsoft/hyper-v-nic.1375909706.txt.gz · Last modified: 2013/08/07 15:08 by gcooper