Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Gathering information about computer name and network card information

$
0
0

Dear Powershell users,

I'm trying to make a Powershell that does the following:
1. Load the computers.txt, inside this *.txt file there are computers listed
2  Gives the computername
3. Gives the network card information about devicename, driverversion, driverdate
4. Writes each computer listed in computers.txt on a new line
5. Save this in a *.csv file 

$computerlist = Get-Content -Path "C:\temp\computers.txt"
$computername = Get-WmiObject Win32_ComputerSystem -cn $computerlist | Select-Object Name
$networkcard = Get-WmiObject Win32_PnPSignedDriver -cn $computerlist | select driverdate, devicename, driverversion | where {$_.devicename -like "*Network Connection*"}

$Object = New-Object PSObject -Property @{
Computername = $computername.Name
Devicename = $networkcard.devicename
Driverdate = $networkcard.DriverDate
Driverversion = $networkcard.driverversion
}
Sort-Object Computername, Devicename, Driverdate, Driverversion
Write-Output $Object | Export-Csv c:\temp\test1232.txt


In my thoughts the output most looks like this
Computername1 - driverdate - devicename -  driverversion
Computername2 - driverdate - devicename -  driverversion
Computername3 - driverdate - devicename -  driverversion
 
Now I have managed to gather some information on the internet, but I don't yet have the knowledge the write my own powershell scripts. Is there anyone who can show me the right direction?

Kind regards,
Martijn 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles