top of page

PowerShell - Win32_NetworkAdapterConfiguration from text list

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

Name as a NetworkDiscoverFromList.ps1 or similar, this takes servers/computers populated in c:\temp\servers.txt and Gets the ENABLED NIC(s), DNSHostName, DHCPEnabled, IPAddress, DefaultIPGateway, DNSDomain, ServiceName, Description, and outputs to C:\temp\AllActiveNetWorkAdapters.TXT

$r = Get-Content c:\temp\servers.txt

If (-Not (Test-Connection -ComputerName $r -Count 1 )) {Continue}

Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName $r | Select DNSHostName, DHCPEnabled, IPAddress, DefaultIPGateway, DNSDomain, ServiceName, Description, Index | FT | Out-File C:\temp\AllActiveNetWorkAdapters.txt


 
 
 

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