-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWindowsTestEval.ps1
More file actions
112 lines (70 loc) · 3.1 KB
/
WindowsTestEval.ps1
File metadata and controls
112 lines (70 loc) · 3.1 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#
# ####################################
# Windows Test Evaluation Script #
######################################
#
# Run this script to gather system information and diagnostics information on Windows endpoints
# to troubleshoot common issues.
#
# Author: Chad Eckles
# Release Date: 30 Oct 2020
#
###########################################################################################
$properties=@(
@{Name="Name"; Expression = {$_.name}},
@{Name="PID"; Expression = {$_.IDProcess}},
@{Name="CPU (%)"; Expression = {$_.PercentProcessorTime}},
@{Name="Memory (MB)"; Expression = {[Math]::Round(($_.workingSetPrivate / 1mb),2)}}
@{Name="Disk (MB)"; Expression = {[Math]::Round(($_.IODataOperationsPersec / 1mb),2)}}
)
$ProcessCPU = Get-WmiObject -class Win32_PerfFormattedData_PerfProc_Process |
Select-Object $properties |
Sort-Object "Memory (MB)" -desc |
Select-Object -First 15
$top_CPU_processes = $ProcessCPU | select *,@{Name="Path";Expression = {(Get-Process -Id $_.PID).Path}} | Format-Table
$hostname=hostname
$update_info=wmic qfe
$datetime = Get-Date
$chrome_version=(Get-Item (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe').'(Default)').VersionInfo | Select ProductVersion | ft -HideTableHeaders | Out-String
$gp_info=gpresult /r
$top_app_errors=Get-EventLog -LogName application -EntryType error | Group source,eventid | Sort count -Descending | select -First 10 | FT count,Name
CLS
Write-Host -NoNewLine "Host Name: "
Get-CimInstance Win32_OperatingSystem | Select-Object CSName | ForEach{ $_.CSName }
Write-Host ""
Write-Host -NoNewLine "Date: "$datetime
Write-Host ""
Write-Host ""
Write-Host -NoNewLine "OS Version: "
Get-CimInstance Win32_OperatingSystem | Select-Object Caption | ForEach{ $_.Caption }
Write-Host ""
Write-Host -NoNewLine "Install Date: "
Get-CimInstance Win32_OperatingSystem | Select-Object InstallDate | ForEach{ $_.InstallDate }
Write-Host ""
Write-Host -NoNewLine "Service Pack Version: "
Get-CimInstance Win32_OperatingSystem | Select-Object ServicePackMajorVersion | ForEach{ $_.ServicePackMajorVersion }
Write-Host ""
Write-Host -NoNewLine "OS Architecture: "
Get-CimInstance Win32_OperatingSystem | Select-Object OSArchitecture | ForEach{ $_.OSArchitecture }
Write-Host ""
Write-Host -NoNewLine "Boot Device: "
Get-CimInstance Win32_OperatingSystem | Select-Object BootDevice | ForEach{ $_.BootDevice }
Write-Host ""
Write-Host -NoNewLine "Build Number: "
Get-CimInstance Win32_OperatingSystem | Select-Object BuildNumber | ForEach{ $_.BuildNumber }
Write-Host ""
Write-Host -NoNewLine "Chrome Version: "$chrome_version.Trim(" `t")
Write-Host "Windows Experience Index Metrics:"
GET-WMIOBJECT WIN32_WINSAT | SELECT-OBJECT CPUSCORE,D3DSCORE,DISKSCORE,GRAPHICSSCORE,MEMORYSCORE
Write-Host ""
Write-Host "Installed Hotfixes: "
$update_info
Write-Host ""
Write-Host "Group Policy Information: "
$gp_info
Write-Host ""
Write-Host "Top 10 Application Errors: "
$top_app_errors
Write-Host ""
Write-Host "Top 15 - Highest CPU Processes: "
$top_CPU_processes