Powershell Script to find the network card model \ drivers details in windows 2008 server

Need help to get the powershell Script to find the network card model \ drivers details on windows 2008 server.

I used the below command in my server, it show the output, but need to get the list of servers to get same output in excell. Not sure how to create the script for the same.

get-wmiobject win32_networkadapter | select netconnectionid, name, InterfaceIndex, netconnectionstatus

Get-NetAdapter -Name ethernet | fl *
LVL 26
Sekar ChinnakannuStaff EngineerAsked:
Who is Participating?
Guy LidbetterCommented:
Hi Sekar, Try this.... just update the file.txt and ExportFile.CSV as required....

Function GetNet {
	$Servers = Get-Content file.txt
	foreach ($Server in $Servers) {
		Get-WmiObject -ComputerName $Server win32_NetworkAdapter | select @{N="Server Name";E={$server}},netconnectionid, name, InterfaceIndex, netconnectionstatus

GetNet | Export-CSV ExportFile.csv -NotypeInformation

Open in new window

Justin YeungSenior Systems EngineerCommented:
try this - require active directory module and powershell 3.0  or higher

$path = "C:\export\export.csv"
$servers = get-adcomputer -filter {operatingsystem -like "*Server*"} -properties OperatingSystem
foreach ($Server in $Servers)
Get-WmiObject -Class win32_networkadapter -ComputerName $server.name | select @{N="Server Name";E={$server.name}},netconnectionid, name, InterfaceIndex, netconnectionstatus | export-csv $path -NoTypeInformation -Append

Open in new window

Sekar ChinnakannuStaff EngineerAuthor Commented:
Don't want to pull all the server s, I  have list of servers in txt file where can I add the list
ashokan jayaramanSenior SpecialistCommented:
try this command  in powershell as we tried recently

esxcli network nic get -n vmnic0(NIC name)

this will fetch you the details
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.