################################### # Titel: Fobsi.ch Hardwarechecker # ################################### # Author: Fabian Schläpfer # # Datum: 19.01.2019 # ################################### #Set-ExecutionPolicy RemoteSigned -ErrorAction SilentlyContinue $UserName = (Get-Item env:\username).Value $ComputerName = (Get-Item env:\Computername).Value $filepath = (Get-ChildItem env:\userprofile).value Add-Content "$Filepath\style.CSS" -Value " body {margin:0px; background-image: url(https://fobsi.ch/live/templates/colorsofdarknew/images/pageglare.png); background-repeat: no-repeat; background-attachment: fixed, fixed, scroll !important; background-color: black; font-family: 'Source Code Pro', monospace;} #wrapper {background-image: url(https://fobsi.ch/live/templates/colorsofdarknew/images/page.png); width:100%; height:100%;} TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;} TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #6495ED;} TD {border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #FFFFFF;} h1 {text-shadow: 2px 2px 5px lightblue h2 {text-shadow: 2px 2px 5px lightblue;} " Write-Host "CSS Datei generiert! bitte warten..." -ForegroundColor Yellow #ReportDate $ReportDate = Get-Date | Select -Property DateTime |ConvertTo-Html -Fragment #Allgmeine Informationen $ComputerSystem = Get-WmiObject -Class Win32_ComputerSystem | Select -Property Model , Manufacturer , Description , PrimaryOwnerName , SystemType |ConvertTo-Html -Fragment #Boot Konfiguration $BootConfiguration = Get-WmiObject -Class Win32_BootConfiguration | Select -Property Name , ConfigurationPath | ConvertTo-Html -Fragment #BIOS Informationen $BIOS = Get-WmiObject -Class Win32_BIOS | Select -Property PSComputerName , Manufacturer , Version | ConvertTo-Html -Fragment #Betriebsystem Informationen $OS = Get-WmiObject -Class Win32_OperatingSystem | Select -Property Caption , CSDVersion , OSArchitecture , OSLanguage | ConvertTo-Html -Fragment #Zeitzonen Information $TimeZone = Get-WmiObject -Class Win32_TimeZone | Select Caption , StandardName | ConvertTo-Html -Fragment #Speichermedien Informationen $Disk = Get-WmiObject -Class Win32_LogicalDisk -Filter DriveType=3 | Select SystemName , DeviceID , @{Name=”size(GB)”;Expression={“{0:N1}” -f($_.size/1gb)}}, @{Name=”freespace(GB)”;Expression={“{0:N1}” -f($_.freespace/1gb)}} | ConvertTo-Html -Fragment #Motherboard Informationen $Motherboard = Get-WmiObject -Class Win32_BaseBoard | Select -Property Manufacturer , Model , Name , SerialNumber , SKU, Product | ConvertTo-Html -Fragment #Prozessor Information $SystemProcessor = Get-WmiObject -Class Win32_Processor | Select SystemName , Name , MaxClockSpeed , Manufacturer , status , SocketDesignation |ConvertTo-Html -Fragment #Speicher Information $PhysicalMemory = Get-WmiObject -Class Win32_PhysicalMemory | Select -Property Tag , SerialNumber , PartNumber , Manufacturer , DeviceLocator, Configuredclockspeed , @{Name="Capacity(GB)";Expression={"{0:N1}" -f ($_.Capacity/1GB)}} | ConvertTo-Html -Fragment ConvertTo-Html -Head " Fobsi.ch - Hardwarechecker " -Body "

Fobsi.ch Hardwarechecker

Bericht erfasst am

$ReportDate

Allgmeine Informationen

$ComputerSystem

Boot Konfiguration

$BootConfiguration

BIOS Informationen

$BIOS

Betriebsystem Informationen

$OS

Zeitzonen Information

$TimeZone

Speichermedien Informationen

$Disk

Motherboard Informationen

$Motherboard

Prozessor Information

$SystemProcessor

Speicher Information

$PhysicalMemory

→ Fobsi.ch die Webbasis von Fabian Schläpfer ←

" -CssUri "$filepath\style.CSS" | Out-File -encoding ASCII "$FilePath\$ComputerName.html" Write-Host "Script fertig Ausgeführt" -ForegroundColor Yellow Invoke-Item -Path "$FilePath\$ComputerName.html"