Inventory Network adapters on remote computers using PowerShell

Spread the words

The following simple script uses the Get-NetAdapter cmdlet to inventory network adapters on remote machines. This script is only working on Windows 8 and up and Windows Server 2012 and up.

I’m using the Get-Content cmdlet to retrieve server information from a txt file and returning the script result to another txt file using the Out-file cmdlet.

$servers = Get-Content C:\Tools\servers.txt

$(foreach ($server in $servers)

{

If(Test-Connection –BufferSize 32 –Count 1 –quiet –ComputerName $server)

{ Get-Netadapter -IncludeHidden -Name * -cimsession $server }

}) | format-list | Out-File C:\Tools\result.txt

Be the first to comment on "Inventory Network adapters on remote computers using PowerShell"

Leave a comment

Your email address will not be published.


*