top of page

PowerShell - Get Win32NetworkAdapterConfiguration from text list

  • Writer: Jon Boyette
    Jon Boyette
  • Jan 11, 2022
  • 1 min read

Updated: Feb 10, 2022

Save as a name.ps1 and populate c:\temp\servers/txt, outputs server/computer information to screen including: IPAddress, Description, DNSServerSearchOrder, WINSPrimaryServer, WINSSecondaryServer, DNSDomain, DefaultIPGateway, MACAddress

$colComputers = get-content C:\temp\servers.txt

foreach ($strComputer in $colComputers)

{

# PowerShell cmdlet to interrogate the Network Adapter

$colItems = get-wmiobject -class "Win32_NetworkAdapterConfiguration" `

-computername $strComputer | Where{$_.IpEnabled -Match "True"}

write-host --Begin-Network-Details-For--> $strComputer

foreach ($objItem in $colItems) {

write-host ""

write-host "IPAddress : " $objItem.IPAddress

Write-Host "Description : " $objItem.Description

write-host "DNS Servers in Order : " $objItem.DNSServerSearchOrder

Write-host "WINS Server Primary : " $objItem.WINSPrimaryServer

Write-Host "WINS Server Secondary : " $objItem.WINSSecondaryServer

Write-Host "DNSDomain : " $objItem.DNSDomain

Write-Host "DefaultIPGateway : " $objItem.DefaultIPGateway

write-host "MAC Address : " $objItem.MACAddress

write-host ""

write-host "--End-Network-Details-For-> $strComputer"

write-host ""



}

}



 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page