74 lines
2.5 KiB
PowerShell
74 lines
2.5 KiB
PowerShell
# ======================
|
|
# Hostinformatie
|
|
# ======================
|
|
$hostname = $env:COMPUTERNAME
|
|
$fqdn = ([System.Net.Dns]::GetHostByName($hostname)).HostName
|
|
$ipAddresses = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.IPAddress -notlike "127.*" }).IPAddress -join ", "
|
|
|
|
# ======================
|
|
# Systeeminformatie
|
|
# ======================
|
|
$computerSystem = Get-CimInstance -ClassName Win32_ComputerSystem
|
|
$manufacturer = $computerSystem.Manufacturer
|
|
$productName = $computerSystem.Model
|
|
$serialNumber = (Get-CimInstance -ClassName Win32_BIOS).SerialNumber
|
|
|
|
# ======================
|
|
# BIOS
|
|
# ======================
|
|
$bios = Get-CimInstance -ClassName Win32_BIOS
|
|
$biosVersion = ($bios.SMBIOSBIOSVersion)
|
|
$biosDate = $bios.ReleaseDate
|
|
|
|
# ======================
|
|
# CPU
|
|
# ======================
|
|
$cpu = Get-CimInstance -ClassName Win32_Processor | Select-Object -First 1
|
|
$cpuModel = $cpu.Name
|
|
$cpuSockets = (Get-CimInstance -ClassName Win32_Processor).Count
|
|
|
|
# ======================
|
|
# GEHEUGEN
|
|
# ======================
|
|
$memoryModules = Get-CimInstance -ClassName Win32_PhysicalMemory
|
|
$memoryTotalGB = [math]::Round(($memoryModules | Measure-Object -Property Capacity -Sum).Sum / 1GB,0)
|
|
|
|
# ======================
|
|
# SCHIJVEN
|
|
# ======================
|
|
$disks = Get-CimInstance -ClassName Win32_DiskDrive | Select-Object DeviceID, Model, Size, MediaType
|
|
$diskCount = $disks.Count
|
|
|
|
# ======================
|
|
# DOKUWIKI OUTPUT
|
|
# ======================
|
|
Write-Output "^ $hostname ^ ^"
|
|
Write-Output "| FQDN | $fqdn |"
|
|
Write-Output "| IP address | $ipAddresses |"
|
|
Write-Output ""
|
|
Write-Output "^ Eigenschap ^ Waarde ^"
|
|
Write-Output "| Fabrikant | $manufacturer |"
|
|
Write-Output "| Productnaam | $productName |"
|
|
if ($null -ne $serialNumber) {
|
|
Write-Output "| Serienummer | $serialNumber |"
|
|
}
|
|
Write-Output "| BIOS-versie | $biosVersion |"
|
|
Write-Output "| BIOS-datum | $biosDate |"
|
|
Write-Output "| CPU-model | $cpuModel |"
|
|
Write-Output "| CPU-sockets | $cpuSockets |"
|
|
Write-Output "| Totaal geheugen | ${memoryTotalGB} GB |"
|
|
Write-Output "| Aantal schijven | $diskCount |"
|
|
Write-Output ""
|
|
Write-Output "^ Schijf ^ Model ^ Grootte ^ Type ^"
|
|
|
|
foreach ($disk in $disks) {
|
|
$diskSizeGB = [math]::Round($disk.Size / 1GB,0)
|
|
$diskType = switch ($disk.MediaType) {
|
|
"Fixed hard disk media" { "HDD" }
|
|
"Removable Media" { "USB/Removable" }
|
|
"SSD" { "SSD" }
|
|
default { "Onbekend" }
|
|
}
|
|
Write-Output "| $($disk.DeviceID) | $($disk.Model) | ${diskSizeGB} GB | $diskType |"
|
|
}
|