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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2008

From novice to tech pro — start learning today.