Skip to content

Commit 382dbce

Browse files
Merge pull request #298 from silversword411/main
Add server version check to Windows 11 readiness script
2 parents c3a7e79 + 9378ed7 commit 382dbce

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

scripts/Win_Win11_Ready.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44
#Returns 'Not Windows 11 Ready' if any of the checks fail, and returns 'Windows 11 Ready' if they all pass.
55
#Useful if running in an automation policy and want to populate a custom field of all agents with their readiness.
66
#This is a modified version of the official Microsoft script here: https://aka.ms/HWReadinessScript
7+
#9/10/2025 silversword411 v1.2 Adding server output
78
#
89
#=============================================================================================================================
910

10-
# Check Windows Version
1111
$osInfo = Get-WmiObject -Class Win32_OperatingSystem
12+
13+
# Check if the OS is a server version
14+
# ProductType=1 is Workstation, 2 is Domain Controller, 3 is Server.
15+
if ($osInfo.ProductType -ne 1) {
16+
Write-Output "$($osInfo.Caption)"
17+
Exit 0
18+
}
19+
20+
# Check Windows Version
1221
$winVersion = [System.Version]$osInfo.Version
1322

1423
if ($winVersion -ge [System.Version]::new(10, 0, 22000)) {
@@ -493,4 +502,4 @@ if (0 -eq $outObject.returncode) {
493502
else {
494503
"Not Windows 11 Ready | "
495504
Write-Output $outObject.returnReason
496-
}
505+
}

0 commit comments

Comments
 (0)