-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhwlist.ps1
34 lines (31 loc) · 1.8 KB
/
hwlist.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# System Information
# Shows hardware and OS details from a list of PCs
$ArrComputers = "."#, "DESKTOP-DJOLE", "DESKTOP-AKI" # list of PC names "." means local system
Clear-Host
foreach ($Computer in $ArrComputers)
{
$computerSystem = get-wmiobject Win32_ComputerSystem -Computer $Computer
$computerBIOS = get-wmiobject Win32_BIOS -Computer $Computer
$computerOS = get-wmiobject Win32_OperatingSystem -Computer $Computer
$computerCPU = get-wmiobject Win32_Processor -Computer $Computer
$computerHDD = Get-WmiObject Win32_LogicalDisk -ComputerName $Computer -Filter drivetype=3
$hdds = Get-WmiObject Win32_LogicalDisk -ComputerName $Computer -Filter drivetype=3
write-host "System Information for: " $computerSystem.Name -BackgroundColor DarkCyan
"-------------------------------------------------------"
"Manufacturer: " + $computerSystem.Manufacturer
"Model: " + $computerSystem.Model
#"Serial Number: " + $computerBIOS.SerialNumber
"CPU: " + $computerCPU.Name
"CPU logical cores: " + $computerCPU.NumberOfLogicalProcessors
foreach ($computerhdd in $hdds) {
"HDD Drive Letter: " + $computerhdd.DeviceID
" HDD Capacity: " + "{0:N2}" -f ($computerHDD.Size/1GB) + "GB"
" HDD Space: " + "{0:P2}" -f ($computerHDD.FreeSpace/$computerHDD.Size) + " Free (" + "{0:N2}" -f ($computerHDD.FreeSpace/1GB) + "GB)"
}
"RAM: " + "{0:N2}" -f ($computerSystem.TotalPhysicalMemory/1GB) + "GB"
"Operating System: " + $computerOS.caption + ", Service Pack: " + $computerOS.ServicePackMajorVersion
"User logged In: " + $computerSystem.UserName
"Last Reboot: " + $computerOS.ConvertToDateTime($computerOS.LastBootUpTime)
""
"-------------------------------------------------------"
}