首页 > 代码库 > Collect logs from the servers

Collect logs from the servers

1. Get system info

systeminfo > "${env:COMPUTERNAME}_systeminfo.txt"


2. Get serial number

Get-WmiObject -Class Win32_BIOS | Select * >"${env:COMPUTERNAME}_bios.txt"


3. Get installed driver version

Get-WmiObject -Class Win32_PnPSignedDriver| select Devicename,Friendlyname, Driverprovidername, Driverversion, Driverdate, Location |export-csv "${env:COMPUTERNAME}_installed_driver.csv"


4. Get installed software version

Get-WmiObject -Class Win32_Product | select Name, Version, Vendor,Caption | export-csv "${env:COMPUTERNAME}_installed_software.csv"


Collect logs from the servers