Powershell IT Support PC Info Script

Loading

I developed this PS script requirements over time with AI to cover useful info about a PC state to aid fault finding - you can paste it straight into the Admin PS terminal:


 

# SCRIPT START: EXECUTE, FORMAT, AND SAVE OUTPUT
$ReportPath = "$env:USERPROFILE\Desktop\System_Diagnostic_Report_$(Get-Date -Format 'yyyyMMdd_HHmm').txt"
"Starting automated diagnostic report creation..." | Out-File $ReportPath
"`r`n--- WARNING: Internet Throughput Test Blocked by Network Security ---" | Out-File $ReportPath -Append

# --- 0. CURRENT USER AND IDENTITY ---
"`r`n--- 0. CURRENT USER AND IDENTITY ---" | Out-File $ReportPath -Append
$CurrentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
$Principal = New-Object Security.Principal.WindowsPrincipal($CurrentUser)
$UserRole = if ($Principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { "Administrator/Privileged" } else { "Standard User" }
$SysInfo = Get-CimInstance Win32_ComputerSystem
$NetworkStatus = if ($SysInfo.PartOfDomain) { "Domain: $($SysInfo.Domain)" } else { "Workgroup: $($SysInfo.Workgroup)" }
"User Name: $($env:USERDOMAIN)\$($env:USERNAME)" | Out-File $ReportPath -Append
"User Type: $($UserRole)" | Out-File $ReportPath -Append
"Network Membership: $($NetworkStatus)" | Out-File $ReportPath -Append

# --- 1. SYSTEM CORE STATUS (V3 ORIGINAL) ---
"`r`n--- 1. SYSTEM CORE STATUS ---" | Out-File $ReportPath -Append
$FriendlyVersion = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -ErrorAction SilentlyContinue).DisplayVersion
Get-ComputerInfo -Property OsName, OsVersion, CsProcessors, CsTotalPhysicalMemory |
Select-Object OsName, OsVersion, @{Name='Update Version'; Expression={$FriendlyVersion}}, CsProcessors, CsTotalPhysicalMemory |
Out-File $ReportPath -Append

# BIOS/Serial and TPM Status
"`r`n--- BIOS / Serial Number ---" | Out-File $ReportPath -Append
Get-CimInstance Win32_Bios | Select-Object Manufacturer, Name, SerialNumber | Out-File $ReportPath -Append
"`r`n--- TPM Status ---" | Out-File $ReportPath -Append
Get-Tpm -ErrorAction SilentlyContinue | Select-Object TpmPresent, TpmReady, TpmEnabled | Out-File $ReportPath -Append

$OS = Get-CimInstance Win32_OperatingSystem
$TotalMB = [math]::Round($OS.TotalVisibleMemorySize / 1024, 0)
$FreeMB = [math]::Round($OS.FreePhysicalMemory / 1024, 0)
$UsedMB = $TotalMB - $FreeMB
"Total RAM: $($TotalMB) MB | Used: $($UsedMB) MB ($([math]::Round(($UsedMB / $TotalMB) * 100, 1))%)" | Out-File $ReportPath -Append
"Last Boot Time: $($OS.LastBootUpTime)" | Out-File $ReportPath -Append

# --- 2. STORAGE STATUS ---
"`r`n--- 2. STORAGE STATUS ---" | Out-File $ReportPath -Append
Get-Volume | Where-Object { $_.DriveLetter } | Select-Object DriveLetter, FileSystemLabel, @{Name='SizeGB'; Expression={[math]::Round($_.Size/1GB,2)}}, @{Name='FreeGB'; Expression={[math]::Round($_.SizeRemaining/1GB,2)}} | Out-File $ReportPath -Append

# --- 3. NETWORKING STATUS (AMENDED WITH IPCONFIG/ADAPTER DETAILS) ---
"`r`n--- 3. NETWORKING STATUS ---" | Out-File $ReportPath -Append
$NetConfig = Get-NetIPConfiguration -All
foreach ($Interface in $NetConfig) {
if ($Interface.IPv4Address) {
"Interface: $($Interface.InterfaceAlias)" | Out-File $ReportPath -Append
" Status: $($Interface.NetAdapter.Status)" | Out-File $ReportPath -Append
" IPv4 Address: $($Interface.IPv4Address.IPAddress)" | Out-File $ReportPath -Append
" Gateway: $($Interface.IPv4DefaultGateway.NextHop)" | Out-File $ReportPath -Append
" DNS Servers: $($Interface.DNSServer.ServerAddresses -join ', ')" | Out-File $ReportPath -Append
"--------------------------------------" | Out-File $ReportPath -Append
}
}
Test-NetConnection -ComputerName google.com -InformationLevel Quiet | Out-File $ReportPath -Append

# --- 4. PERFORMANCE SETTINGS (V3 ORIGINAL) ---
"`r`n--- 4. PERFORMANCE SETTINGS (Visual Effects) ---" | Out-File $ReportPath -Append
$FXSetting = (Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name VisualFXSetting -ErrorAction SilentlyContinue).VisualFXSetting
$FXOutput = switch ($FXSetting) { 0 {"Let Windows Choose"}; 1 {"Best Appearance"}; 2 {"Best Performance"}; 3 {"Custom"}; Default {"Unknown"} }
"Visual Effects: $FXOutput" | Out-File $ReportPath -Append

# --- 5. DEVICE AND I/O STATUS (V3 ORIGINAL) ---
"`r`n--- 5. DEVICE AND I/O STATUS ---" | Out-File $ReportPath -Append
Get-PnpDevice -Class 'Display', 'Keyboard', 'Mouse', 'HIDClass', 'Image', 'USBDevice' -ErrorAction SilentlyContinue | Select-Object FriendlyName, Class, Status | Out-File $ReportPath -Append

# --- 6. STABILITY/LOGS ---
"`r`n--- 6. STABILITY/LOGS ---" | Out-File $ReportPath -Append
try {
Get-WinEvent -FilterHashTable @{LogName='System'; Level=1,2; StartTime=(Get-Date -Hour 0 -Minute 0 -Second 0)} -ErrorAction Stop |
Select-Object TimeCreated, Id, Message -First 10 | Out-File $ReportPath -Append
} catch { "RESULT: [ACCESS DENIED] - Standard User" | Out-File $ReportPath -Append }

# --- 7. SECURITY STATUS (V3 ORIGINAL) ---
"`r`n--- 7. SECURITY STATUS ---" | Out-File $ReportPath -Append
try {
$BL = Get-BitLockerVolume -MountPoint C: -ErrorAction Stop
"BitLocker C: $($BL.VolumeStatus)" | Out-File $ReportPath -Append
} catch { "BitLocker C: [ACCESS DENIED]" | Out-File $ReportPath -Append }

# --- 8. ANTIVIRUS STATUS (V3 ORIGINAL) ---
"`r`n--- 8. ANTIVIRUS STATUS ---" | Out-File $ReportPath -Append
$Defender = Get-Service -Name WinDefend -ErrorAction SilentlyContinue
if ($Defender) { "Defender Service: $($Defender.Status)" | Out-File $ReportPath -Append }
Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntiVirusProduct -ErrorAction SilentlyContinue | Select-Object displayName, productState | Out-File $ReportPath -Append

# --- 9. INSTALLED SOFTWARE (V3 ORIGINAL) ---
"`r`n--- 9. INSTALLED SOFTWARE AND VERSIONS ---" | Out-File $ReportPath -Append
$LegacyPaths = @("HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*", "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*")
$LegacyApps = Get-ItemProperty -Path $LegacyPaths -ErrorAction SilentlyContinue | Where-Object { $_.DisplayName -ne $null } | Select-Object @{Name='DisplayName'; Expression={$_.DisplayName}}, @{Name='DisplayVersion'; Expression={$_.DisplayVersion}}
$UWPApps = Get-AppxPackage | Where-Object { -not $_.IsFramework } | Select-Object @{Name='DisplayName'; Expression={$_.Name}}, @{Name='DisplayVersion'; Expression={$_.Version}}
($LegacyApps + $UWPApps) | Sort-Object DisplayName | Out-File $ReportPath -Append

# --- REPORT COMPLETION ---
"`r`n--- Report Generation Complete ---" | Out-File $ReportPath -Append
Write-Output "Diagnostic report saved to: $ReportPath"

 

This script give a text file output to the Desktop with PC details:


Starting automated diagnostic report creation...

--- WARNING: Internet Throughput Test Blocked by Network Security ---

--- 0. CURRENT USER AND IDENTITY ---
User Name: BABY\steve
User Type: Administrator/Privileged
Network Membership: Workgroup: WORKGROUP

--- 1. SYSTEM CORE STATUS ---

OsName : Microsoft Windows 11 Pro
OsVersion : 10.0.26100
Update Version : 24H2
CsProcessors : {12th Gen Intel(R) Core(TM) i3-1215U}
CsTotalPhysicalMemory : 12581920768

 

--- BIOS / Serial Number ---

Manufacturer Name SerialNumber
------------ ---- ------------
Insyde F.17 1H945108LJ

 

--- TPM Status ---

TpmPresent TpmReady TpmEnabled
---------- -------- ----------
True True True

Total RAM: 11999 MB | Used: 6672 MB (55.6%)
Last Boot Time: 12/27/2025 15:27:14

--- 2. STORAGE STATUS ---

DriveLetter FileSystemLabel SizeGB FreeGB
----------- --------------- ------ ------
C WINDOWS 475.87 194.01

 

--- 3. NETWORKING STATUS ---
Interface: WiFi 2
Status: Up
IPv4 Address: 192.168.1.102
Gateway: 192.168.1.1
DNS Servers: 192.168.1.1
--------------------------------------
Interface: Local Area Connection* 2
Status: Disconnected
IPv4 Address: 169.254.49.7
Gateway:
DNS Servers: fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3
--------------------------------------
Interface: Local Area Connection* 1
Status: Disconnected
IPv4 Address: 169.254.185.104
Gateway:
DNS Servers: fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3
--------------------------------------
True

--- 4. PERFORMANCE SETTINGS (Visual Effects) ---
Visual Effects: Unknown

--- 5. DEVICE AND I/O STATUS ---

FriendlyName Class Status
------------ ----- ------
ELAN Input Device Mouse OK
Intel(R) UHD Graphics Display OK
I2C HID Device HIDClass OK
Camera DFU Device USBDevice OK
ELAN HID Class Filter Driver HIDClass OK
Standard PS/2 Keyboard Keyboard OK
ELAN PrecisionTouchpad Filter Driver HIDClass OK
Microsoft Input Configuration Device HIDClass OK

 

--- 6. STABILITY/LOGS ---

TimeCreated Id Message
----------- -- -------
28/12/2025 11:01:26 1796 The Secure Boot update failed to update a Secure Boot variable with error Unknown HResult ...
28/12/2025 11:01:24 10317 Miniport Microsoft Wi-Fi Direct Virtual Adapter #2, {2c0bc924-0f20-471b-9317-d743d7318bbb}...
28/12/2025 01:23:29 10317 Miniport Microsoft Wi-Fi Direct Virtual Adapter #2, {2c0bc924-0f20-471b-9317-d743d7318bbb}...

 

--- 7. SECURITY STATUS ---
BitLocker C: FullyEncrypted

--- 8. ANTIVIRUS STATUS ---
Defender Service: Running

displayName productState
----------- ------------
Windows Defender 397568

 

--- 9. INSTALLED SOFTWARE AND VERSIONS ---

DisplayName DisplayVersion
----------- --------------
1527c705-839a-4832-9118-54d4Bd6a0c89 10.0.19640.1000
5319275A.WhatsAppDesktop 2.2587.9.0
AD2F1837.HPAudioCenter 1.47.308.0
AD2F1837.HPPCHardwareDiagnosticsWindows 2.9.0.0
AD2F1837.HPSystemEventUtility 3.2.15.0
aimgr 0.20.34.0
AppUp.IntelGraphicsExperience 1.100.5688.0
AppUp.IntelOptaneMemoryandStorageManagement 20.0.1021.0
c5e2524a-ea46-4f67-841f-6a9465d9d515 10.0.26100.1
E2A4F912-2574-4A75-9BB0-0D023378592B 10.0.19640.1000
F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE 10.0.26100.1
Google Chrome 143.0.7499.170
Google Drive 118.0.1.0
Google Update Helper 1.3.35.451
HP Audio Switch 1.0.211.0
HP Connection Optimizer 2.0.19.0
Microsoft 365 - en-us 16.0.19426.20218
Microsoft 365 - es-es 16.0.19426.20218
Microsoft Edge 143.0.3650.96
Microsoft Edge WebView2 Runtime 143.0.3650.96
Microsoft OneNote - en-us 16.0.19426.20218
Microsoft OneNote - es-es 16.0.19426.20218
Microsoft.AAD.BrokerPlugin 1000.19580.1000.2
Microsoft.AccountsControl 10.0.26100.1
Microsoft.ApplicationCompatibilityEnhancements 1.2511.9.0
Microsoft.AsyncTextService 10.0.26100.1
Microsoft.AV1VideoExtension 2.0.6.0
Microsoft.AVCEncoderVideoExtension 1.1.21.0
Microsoft.BingSearch 1.1.40.0
Microsoft.BingWeather 4.54.63029.0
Microsoft.BioEnrollment 10.0.19587.1000
Microsoft.CredDialogHost 10.0.19595.1001
Microsoft.DesktopAppInstaller 1.27.350.0
Microsoft.ECApp 10.0.26100.4061
Microsoft.GetHelp 10.2409.33293.0
Microsoft.HEIFImageExtension 1.2.28.0
Microsoft.LanguageExperiencePacken-GB 26100.118.226.0
Microsoft.LanguageExperiencePackes-MX 26100.111.215.0
Microsoft.LockApp 10.0.26100.3323
Microsoft.MicrosoftEdge.Stable 142.0.3595.94
Microsoft.MicrosoftEdgeDevToolsClient 1000.25128.1000.0
Microsoft.MixedReality.Portal 2000.21051.1282.0
Microsoft.MPEG2VideoExtension 1.2.13.0
Microsoft.Office.ActionsServer 16.0.19426.20218
Microsoft.OfficePushNotificationUtility 16.0.19426.20218
Microsoft.OneDriveSync 25209.1026.2.0
Microsoft.OutlookForWindows 1.2024.103.100
Microsoft.Paint 11.2510.311.0
Microsoft.PowerAutomateDesktop 11.2512.163.0
Microsoft.ScreenSketch 11.2510.31.0
Microsoft.SecHealthUI 1000.29429.1000.0
Microsoft.StartExperiencesApp 1.195.0.0
Microsoft.StorePurchaseApp 22510.1401.4.0
Microsoft.VP9VideoExtensions 1.2.12.0
Microsoft.WebMediaExtensions 1.2.17.0
Microsoft.WebpImageExtension 1.2.14.0
Microsoft.Whiteboard 55.20610.576.0
Microsoft.WidgetsPlatformRuntime 1.6.14.0
Microsoft.Win32WebViewHost 10.0.26100.1
Microsoft.WinAppRuntime.DDLM.4000.964.11.0-x6 4000.964.11.0
Microsoft.WinAppRuntime.DDLM.4000.964.11.0-x8 4000.964.11.0
Microsoft.Windows.Apprep.ChxApp 1000.25128.1000.0
Microsoft.Windows.AssignedAccessLockApp 1000.25128.1000.0
Microsoft.Windows.CapturePicker 10.0.19580.1000
Microsoft.Windows.CloudExperienceHost 10.0.26100.1
Microsoft.Windows.ContentDeliveryManager 10.0.26100.1
Microsoft.Windows.DevHome 0.2101.858.0
Microsoft.Windows.NarratorQuickStart 10.0.26100.1
Microsoft.Windows.OOBENetworkCaptivePortal 10.0.26100.1000
Microsoft.Windows.OOBENetworkConnectionFlow 10.0.21302.1000
Microsoft.Windows.ParentalControls 1000.25128.1000.0
Microsoft.Windows.PeopleExperienceHost 10.0.26100.1
Microsoft.Windows.Photos 2025.11120.5001.0
Microsoft.Windows.PinningConfirmationDialog 1000.25140.1001.0
Microsoft.Windows.PrintQueueActionCenter 1.0.2.0
Microsoft.Windows.SecureAssessmentBrowser 10.0.26100.1
Microsoft.Windows.ShellExperienceHost 10.0.26100.3624
Microsoft.Windows.StartMenuExperienceHost 10.0.26100.3323
Microsoft.Windows.XGpuEjectDialog 10.0.26100.1
Microsoft.WindowsAlarms 11.2510.4.0
Microsoft.WindowsCamera 2025.2510.2.0
microsoft.windowscommunicationsapps 16005.14326.22342.0
Microsoft.WindowsNotepad 11.2508.38.0
Microsoft.WindowsSoundRecorder 11.2510.0.0
Microsoft.WindowsStore 22511.1401.5.0
Microsoft.WindowsTerminal 1.23.13503.0
Microsoft.XboxGameCallableUI 1000.25128.1000.0
Microsoft.XboxGameOverlay 1.54.4001.0
Microsoft.XboxGamingOverlay 7.325.11061.0
Microsoft.XboxIdentityProvider 12.130.16001.0
Microsoft.XboxSpeechToTextOverlay 1.97.17002.0
Microsoft.YourPhone 1.25112.36.0
Microsoft.ZuneMusic 11.2510.7.0
MicrosoftCorporationII.QuickAssist 2.0.29.0
MicrosoftCorporationII.WinAppRuntime.Main.1.4 4000.1309.2056.0
MicrosoftCorporationII.WinAppRuntime.Singleton 8000.675.1142.0
MicrosoftCorporationII.WindowsSubsystemForLinux 2.6.3.0
MicrosoftTeams 23285.3703.2471.4627
MicrosoftWindows.55182690.Taskbar 1000.26100.4061.0
MicrosoftWindows.Client.CBS 1000.26100.84.0
MicrosoftWindows.Client.Core 1000.26100.39.0
MicrosoftWindows.Client.CoreAI 1000.26100.4061.0
MicrosoftWindows.Client.FileExp 1000.26100.3.0
MicrosoftWindows.Client.OOBE 1000.26100.4.0
MicrosoftWindows.Client.Photon 1000.26100.8.0
MicrosoftWindows.Client.WebExperience 525.31002.150.0
MicrosoftWindows.CrossDevice 1.25112.60.0
MicrosoftWindows.LKG.TwinSxS 1000.26100.4061.0
MicrosoftWindows.UndockedDevKit 10.0.26100.1
MSTeams 24295.605.3225.8804
Office 16 Click-to-Run Extensibility Component 16.0.19426.20170
Office 16 Click-to-Run Licensing Component 16.0.14326.20454
Office 16 Click-to-Run Localization Component 16.0.19426.20170
Windows Subsystem for Linux 2.6.3.0
Windows.CBSPreview 10.0.19580.1000
windows.immersivecontrolpanel 10.0.8.1000
Windows.PrintDialog 6.2.3.0

 

--- Report Generation Complete ---