In this article, we’ll look at how to use the official Microsoft HardwareReadiness.ps1 PowerShell script to perform a bulk Windows 11 hardware compatibility check on domain computers.
This script checks that the computer meets the following minimum requirements to run Windows 11:
- Compatible x64 processor (full list of supported CPUs)
- 4+ GB RAM
- Minimum 64 GB hard drive size
- Device with UEFI and Secure Boot enabled
- Video card compatible with DirectX 12 and WDDM 2.0 drivers
- TPM 2.0 module
To manually check that a specific machine’s hardware is compatible with Windows 11 requirements:
- Download the HardwareReadiness.ps1 script (https://aka.ms/HWReadinessScript).
- Open an elevated Windows PowerShell console (the script uses the
Get-WMIObject
cmdlet, which is not supported in recent versions of PowerShell Core) - Enable PowerShell script execution in the current session:
Set-ExecutionPolicy -Scope Process RemoteSigned
- Run the script:
.\HardwareReadiness.ps1
The script has returned the code 0. This means your computer meets the hardware requirements for Windows 11 (returncode:0 , resurnresult=CAPABLE
).
{"returnCode":0,"returnReason":"","logging":"Storage: OSDiskSize=427GB. PASS; Memory: System_Memory=32GB. PASS; TPM: TPMVersion=2.0, 0, 1.38. PASS; Processor: {AddressWidth=64; MaxClockSpeed=3901; NumberOfLogicalCores=12; Manufacturer=AuthenticAMD; Caption=AMD64 Family 25 Model 80 Stepping 0; }. PASS; SecureBoot: Capable. PASS; ","returnResult":"CAPABLE"}
Suppose you need to perform a mass Windows 11 compatibility check on enterprise computers. In that case, you can run this PowerShell script and collect information using tools such as SCCM, Intune, or even WSUS (which can also deploy third-party software and scripts). For simple cases, you can run this PowerShell script through Group Policies and save the results in the computer object properties in Active Directory.
The original script code needs to be modified slightly.
Edit the HardwareReadiness.ps1 file and add the following code at the end, before the #SIG # Begin signature block:
$outObject = $outObject | ConvertTo-Json -Compress
$computer = $env:COMPUTERNAME
$ComputerSearcher = New-Object DirectoryServices.DirectorySearcher
# Specify your domain name
$ComputerSearcher.SearchRoot = "LDAP://DC=WOSHUB,DC=LOC"
$ComputerSearcher.Filter = "(&(objectCategory=Computer)(CN=$Computer))"
$computerObj = [ADSI]$ComputerSearcher.FindOne().Path
$computerObj.Put( "Info", $outObject )
$computerObj.SetInfo()
This PowerShell code writes Windows 11 compatibility information to the Info computer attribute in Active Directory.
Copy the PS1 script file to the \\woshub.loc\Netlogon
folder on the domain controller.
Open the Domain Group Policy Management console (gpmc.msc
), create a new GPO, and link it to the computer’s OU.
Navigate to Computer Configuration -> Policies -> Windows Settings -> Scripts (Startup / Shutdown) -> Startup -> tab PowerShell Scripts, and specify the UNC path to the HardwareReadiness.ps1 script
Go to Computer Configuration -> Administrative Templates -> System -> Group Policy. Enable the policy Configure Logon Script Delay and set a 1-minute script execution delay.
Also, enable the Always wait for the network at computer startup and logon option under Computer Configuration -> Admin Templates -> System -> Logon.
Reboot the client’s computer. Start the ADUC console (dsa.msc
) and open the computer properties. Go to the Attribute Editor tab and check that the Info parameter now contains the results of checking your computer for Windows 11 compatibility. In the Attribute Editor tab, check that the Info parameter now contains the results of your computer’s Windows 11 compatibility check.
Once the logon script has been run on all computers, you can quickly view information about compatible and incompatible computers from Active Directory by using the Get-ADComputer cmdlet:
Get-ADComputer -Filter {enabled -eq "true"} -properties *| Where-Object {$_.info -ne $null}
For more detailed information about incompatible computers and specific computer hardware that does not meet the Win 11 minimum requirements, run the following PowerShell script:
$Report = @() $computers = Get-ADComputer -Filter {enabled -eq "true"} -properties *| Where-Object { $_.Info -match '"returnCode":1'} foreach ($computer in $computers){ $jsonString =$computer.info $object = $jsonString | ConvertFrom-Json $returnReasonValues = $object.returnReason -split ', ' $CompInfo = [PSCustomObject]@{ "Computer" = $computer.name "NonCompatibleItems" = $returnReasonValues } $Report += $CompInfo } $Report|fl
2 comments
Hi , thanks for sharing excellent script , I tried it and its giving expected output like TPM and processor. However its not showing if SecureBoot is not compatible.
here is the sample {“returnCode”:1,”returnReason”:”TPM, Processor, SecureBoot, ” if I capture the output in CSV file then it skips it. Please help
Hi again , modified however still getting below error
{“returnCode”:1,”returnReason”:”TPM, Processor, “,”logging”:”Storage: OSDiskSize=232GB. PASS; Memory: System_Memory=8GB. PASS; TPM: TPMVersion=1.2, 2, 3. FAIL; Processor: {AddressWidth=64; MaxClockSpeed=2195; NumberOfLogicalCores=4; Manufacturer=GenuineIntel; Caption=Intel64 Family 6 Model 61 Stepping 4; }. FAIL; SecureBoot: Undetermined. UNDETERMINED; UnauthorizedAccessException Unable to set proper privileges. Access was denied.; “,”returnResult”:”NOT CAPABLE”}