{"id":420619,"date":"2025-02-06T12:59:38","date_gmt":"2025-02-06T12:59:38","guid":{"rendered":"https:\/\/www.ninjaone.com\/?post_type=script_hub&#038;p=420619"},"modified":"2025-02-06T12:59:38","modified_gmt":"2025-02-06T12:59:38","slug":"windows-11-kompatibilitaetstests-powershell","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/de\/script-hub\/windows-11-kompatibilitaetstests-powershell\/","title":{"rendered":"PowerShell-Kompatibilit\u00e4tspr\u00fcfung f\u00fcr die Migration auf Windows 11"},"content":{"rendered":"<h2>Vorwort<\/h2>\n<p>Bei der Vorbereitung von System-Upgrades stehen IT-Expert:innen vor der Herausforderung, die Kompatibilit\u00e4t mit neuen Betriebssystemen sicherzustellen. Dies gilt insbesondere f\u00fcr die Migration auf Windows 11, bei der die Hardwarekompatibilit\u00e4t eine wichtige Rolle spielt. Ein PowerShell-Skript zur Bewertung dieser Kompatibilit\u00e4t rationalisiert den Prozess und liefert klare, umsetzbare Erkenntnisse.<\/p>\n<h2>Kontext<\/h2>\n<p>Das thematisierte Skript f\u00fcr Windows 11-Kompatibilit\u00e4tstests ist ein PowerShell-Tool, mit dem die Bereitschaft eines Computers f\u00fcr ein Upgrade auf Windows 11 bewertet werden kann. Im IT-Sektor ist es von entscheidender Bedeutung, dass die Hardware mit neuer Software kompatibel ist. Dies gilt insbesondere f\u00fcr <a href=\"https:\/\/www.ninjaone.com\/de\/was-ist-ein-msp\/\">Managed Service Provider (MSPs)<\/a>, die mehrere Kund:innen mit unterschiedlichen Hardwareumgebungen betreuen. Das Skript automatisiert den Bewertungsprozess, spart Zeit und verringert das Risiko manueller Fehler.<\/p>\n<h2>Das Skript f\u00fcr Windows 11-Kompatibilit\u00e4tstests<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    Checks the computer if is capable of upgrading to Windows 11.\r\n.DESCRIPTION\r\n    Checks the computer if is capable of upgrading to Windows 11 and returns the results.\r\n.EXAMPLE\r\n    No Parameters Needed.\r\n    Will return an exit code of 0 if the computer is capable.\r\n    Will return an exit code of 1 if the computer is not capable.\r\n    Will return an exit code of -1 if the computer is undetermined.\r\n    Will return an exit code of -2 if the computer failed to run the check.\r\n.EXAMPLE\r\n    -CustomField \"Windows11Upgrade\"\r\n    Will attempt to set the example custom field named \"Windows11Upgrade\" with one of the possible results:\r\n    Capable\r\n    Not Capable\r\n    Undetermined\r\n    Failed To Run\r\n.NOTES\r\n    Minimum OS Architecture Supported: Windows 10\r\n    Release Notes: Renamed script and added Script Variable support. Also replaced Get-WmiObject with Get-CimInstance.\r\nBy using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https:\/\/www.ninjaone.com\/terms-of-use.\r\n    Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms. \r\n    Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party. \r\n    Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library or website belonging to or under the control of any other software provider. \r\n    Warranty Disclaimer: The script is provided \u201cas is\u201d and \u201cas available\u201d, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations. \r\n    Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks. \r\n    Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script. \r\n    EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).\r\n#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    [string]$CustomField\r\n)\r\n\r\nbegin {\r\n    if ($env:customFieldName -and $env:customFieldName -notlike \"null\") { $CustomField = $env:customFieldName }\r\n    function Get-HardwareReadiness() {\r\n        # Modified copy of https:\/\/aka.ms\/HWReadinessScript minus the signature, as of 7\/26\/2023.\r\n        # Only modification was replacing Get-WmiObject with Get-CimInstance for PowerShell 7 compatibility\r\n        # Source Microsoft article: https:\/\/techcommunity.microsoft.com\/t5\/microsoft-endpoint-manager-blog\/understanding-readiness-for-windows-11-with-microsoft-endpoint\/ba-p\/2770866\r\n\r\n        #=============================================================================================================================\r\n        #\r\n        # Script Name:     HardwareReadiness.ps1\r\n        # Description:     Verifies the hardware compliance. Return code 0 for success. \r\n        #                  In case of failure, returns non zero error code along with error message.\r\n\r\n        # This script is not supported under any Microsoft standard support program or service and is distributed under the MIT license\r\n\r\n        # Copyright (C) 2021 Microsoft Corporation\r\n\r\n        # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation\r\n        # files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy,\r\n        # modify, merge, publish, distribute, sublicense, and\/or sell copies of the Software, and to permit persons to whom the Software\r\n        # is furnished to do so, subject to the following conditions:\r\n\r\n        # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r\n\r\n        # THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\r\n        # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r\n        # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\r\n        # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r\n\r\n        #=============================================================================================================================\r\n\r\n        $exitCode = 0\r\n\r\n        [int]$MinOSDiskSizeGB = 64\r\n        [int]$MinMemoryGB = 4\r\n        [Uint32]$MinClockSpeedMHz = 1000\r\n        [Uint32]$MinLogicalCores = 2\r\n        [Uint16]$RequiredAddressWidth = 64\r\n\r\n        $PASS_STRING = \"PASS\"\r\n        $FAIL_STRING = \"FAIL\"\r\n        $FAILED_TO_RUN_STRING = \"FAILED TO RUN\"\r\n        $UNDETERMINED_CAPS_STRING = \"UNDETERMINED\"\r\n        $UNDETERMINED_STRING = \"Undetermined\"\r\n        $CAPABLE_STRING = \"Capable\"\r\n        $NOT_CAPABLE_STRING = \"Not capable\"\r\n        $CAPABLE_CAPS_STRING = \"CAPABLE\"\r\n        $NOT_CAPABLE_CAPS_STRING = \"NOT CAPABLE\"\r\n        $STORAGE_STRING = \"Storage\"\r\n        $OS_DISK_SIZE_STRING = \"OSDiskSize\"\r\n        $MEMORY_STRING = \"Memory\"\r\n        $SYSTEM_MEMORY_STRING = \"System_Memory\"\r\n        $GB_UNIT_STRING = \"GB\"\r\n        $TPM_STRING = \"TPM\"\r\n        $TPM_VERSION_STRING = \"TPMVersion\"\r\n        $PROCESSOR_STRING = \"Processor\"\r\n        $SECUREBOOT_STRING = \"SecureBoot\"\r\n        $I7_7820HQ_CPU_STRING = \"i7-7820hq CPU\"\r\n\r\n        # 0=name of check, 1=attribute checked, 2=value, 3=PASS\/FAIL\/UNDETERMINED\r\n        $logFormat = '{0}: {1}={2}. {3}; '\r\n\r\n        # 0=name of check, 1=attribute checked, 2=value, 3=unit of the value, 4=PASS\/FAIL\/UNDETERMINED\r\n        $logFormatWithUnit = '{0}: {1}={2}{3}. {4}; '\r\n\r\n        # 0=name of check.\r\n        $logFormatReturnReason = '{0}, '\r\n\r\n        # 0=exception.\r\n        $logFormatException = '{0}; '\r\n\r\n        # 0=name of check, 1= attribute checked and its value, 2=PASS\/FAIL\/UNDETERMINED\r\n        $logFormatWithBlob = '{0}: {1}. {2}; '\r\n\r\n        # return returnCode is -1 when an exception is thrown. 1 if the value does not meet requirements. 0 if successful. -2 default, script didn't run.\r\n        $outObject = @{ returnCode = -2; returnResult = $FAILED_TO_RUN_STRING; returnReason = \"\"; logging = \"\" }\r\n\r\n        # NOT CAPABLE(1) state takes precedence over UNDETERMINED(-1) state\r\n        function Private:UpdateReturnCode {\r\n            param(\r\n                [Parameter(Mandatory = $true)]\r\n                [ValidateRange(-2, 1)]\r\n                [int] $ReturnCode\r\n            )\r\n\r\n            Switch ($ReturnCode) {\r\n\r\n                0 {\r\n                    if ($outObject.returnCode -eq -2) {\r\n                        $outObject.returnCode = $ReturnCode\r\n                    }\r\n                }\r\n                1 {\r\n                    $outObject.returnCode = $ReturnCode\r\n                }\r\n                -1 {\r\n                    if ($outObject.returnCode -ne 1) {\r\n                        $outObject.returnCode = $ReturnCode\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        $Source = @\"\r\nusing Microsoft.Win32;\r\nusing System;\r\nusing System.Runtime.InteropServices;\r\n\r\n    public class CpuFamilyResult\r\n    {\r\n        public bool IsValid { get; set; }\r\n        public string Message { get; set; }\r\n    }\r\n\r\n    public class CpuFamily\r\n    {\r\n        [StructLayout(LayoutKind.Sequential)]\r\n        public struct SYSTEM_INFO\r\n        {\r\n            public ushort ProcessorArchitecture;\r\n            ushort Reserved;\r\n            public uint PageSize;\r\n            public IntPtr MinimumApplicationAddress;\r\n            public IntPtr MaximumApplicationAddress;\r\n            public IntPtr ActiveProcessorMask;\r\n            public uint NumberOfProcessors;\r\n            public uint ProcessorType;\r\n            public uint AllocationGranularity;\r\n            public ushort ProcessorLevel;\r\n            public ushort ProcessorRevision;\r\n        }\r\n\r\n        [DllImport(\"kernel32.dll\")]\r\n        internal static extern void GetNativeSystemInfo(ref SYSTEM_INFO lpSystemInfo);\r\n\r\n        public enum ProcessorFeature : uint\r\n        {\r\n            ARM_SUPPORTED_INSTRUCTIONS = 34\r\n        }\r\n\r\n        [DllImport(\"kernel32.dll\")]\r\n        [return: MarshalAs(UnmanagedType.Bool)]\r\n        static extern bool IsProcessorFeaturePresent(ProcessorFeature processorFeature);\r\n\r\n        private const ushort PROCESSOR_ARCHITECTURE_X86 = 0;\r\n        private const ushort PROCESSOR_ARCHITECTURE_ARM64 = 12;\r\n        private const ushort PROCESSOR_ARCHITECTURE_X64 = 9;\r\n\r\n        private const string INTEL_MANUFACTURER = \"GenuineIntel\";\r\n        private const string AMD_MANUFACTURER = \"AuthenticAMD\";\r\n        private const string QUALCOMM_MANUFACTURER = \"Qualcomm Technologies Inc\";\r\n\r\n        public static CpuFamilyResult Validate(string manufacturer, ushort processorArchitecture)\r\n        {\r\n            CpuFamilyResult cpuFamilyResult = new CpuFamilyResult();\r\n\r\n            if (string.IsNullOrWhiteSpace(manufacturer))\r\n            {\r\n                cpuFamilyResult.IsValid = false;\r\n                cpuFamilyResult.Message = \"Manufacturer is null or empty\";\r\n                return cpuFamilyResult;\r\n            }\r\n\r\n            string registryPath = \"HKEY_LOCAL_MACHINE\\\\Hardware\\\\Description\\\\System\\\\CentralProcessor\\\\0\";\r\n            SYSTEM_INFO sysInfo = new SYSTEM_INFO();\r\n            GetNativeSystemInfo(ref sysInfo);\r\n\r\n            switch (processorArchitecture)\r\n            {\r\n                case PROCESSOR_ARCHITECTURE_ARM64:\r\n\r\n                    if (manufacturer.Equals(QUALCOMM_MANUFACTURER, StringComparison.OrdinalIgnoreCase))\r\n                    {\r\n                        bool isArmv81Supported = IsProcessorFeaturePresent(ProcessorFeature.ARM_SUPPORTED_INSTRUCTIONS);\r\n\r\n                        if (!isArmv81Supported)\r\n                        {\r\n                            string registryName = \"CP 4030\";\r\n                            long registryValue = (long)Registry.GetValue(registryPath, registryName, -1);\r\n                            long atomicResult = (registryValue &gt;&gt; 20) &amp; 0xF;\r\n\r\n                            if (atomicResult &gt;= 2)\r\n                            {\r\n                                isArmv81Supported = true;\r\n                            }\r\n                        }\r\n\r\n                        cpuFamilyResult.IsValid = isArmv81Supported;\r\n                        cpuFamilyResult.Message = isArmv81Supported ? \"\" : \"Processor does not implement ARM v8.1 atomic instruction\";\r\n                    }\r\n                    else\r\n                    {\r\n                        cpuFamilyResult.IsValid = false;\r\n                        cpuFamilyResult.Message = \"The processor isn't currently supported for Windows 11\";\r\n                    }\r\n\r\n                    break;\r\n\r\n                case PROCESSOR_ARCHITECTURE_X64:\r\n                case PROCESSOR_ARCHITECTURE_X86:\r\n\r\n                    int cpuFamily = sysInfo.ProcessorLevel;\r\n                    int cpuModel = (sysInfo.ProcessorRevision &gt;&gt; 8) &amp; 0xFF;\r\n                    int cpuStepping = sysInfo.ProcessorRevision &amp; 0xFF;\r\n\r\n                    if (manufacturer.Equals(INTEL_MANUFACTURER, StringComparison.OrdinalIgnoreCase))\r\n                    {\r\n                        try\r\n                        {\r\n                            cpuFamilyResult.IsValid = true;\r\n                            cpuFamilyResult.Message = \"\";\r\n\r\n                            if (cpuFamily &gt;= 6 &amp;&amp; cpuModel &lt;= 95 &amp;&amp; !(cpuFamily == 6 &amp;&amp; cpuModel == 85))\r\n                            {\r\n                                cpuFamilyResult.IsValid = false;\r\n                                cpuFamilyResult.Message = \"\";\r\n                            }\r\n                            else if (cpuFamily == 6 &amp;&amp; (cpuModel == 142 || cpuModel == 158) &amp;&amp; cpuStepping == 9)\r\n                            {\r\n                                string registryName = \"Platform Specific Field 1\";\r\n                                int registryValue = (int)Registry.GetValue(registryPath, registryName, -1);\r\n\r\n                                if ((cpuModel == 142 &amp;&amp; registryValue != 16) || (cpuModel == 158 &amp;&amp; registryValue != 8))\r\n                                {\r\n                                    cpuFamilyResult.IsValid = false;\r\n                                }\r\n                                cpuFamilyResult.Message = \"PlatformId \" + registryValue;\r\n                            }\r\n                        }\r\n                        catch (Exception ex)\r\n                        {\r\n                            cpuFamilyResult.IsValid = false;\r\n                            cpuFamilyResult.Message = \"Exception:\" + ex.GetType().Name;\r\n                        }\r\n                    }\r\n                    else if (manufacturer.Equals(AMD_MANUFACTURER, StringComparison.OrdinalIgnoreCase))\r\n                    {\r\n                        cpuFamilyResult.IsValid = true;\r\n                        cpuFamilyResult.Message = \"\";\r\n\r\n                        if (cpuFamily &lt; 23 || (cpuFamily == 23 &amp;&amp; (cpuModel == 1 || cpuModel == 17)))\r\n                        {\r\n                            cpuFamilyResult.IsValid = false;\r\n                        }\r\n                    }\r\n                    else\r\n                    {\r\n                        cpuFamilyResult.IsValid = false;\r\n                        cpuFamilyResult.Message = \"Unsupported Manufacturer: \" + manufacturer + \", Architecture: \" + processorArchitecture + \", CPUFamily: \" + sysInfo.ProcessorLevel + \", ProcessorRevision: \" + sysInfo.ProcessorRevision;\r\n                    }\r\n\r\n                    break;\r\n\r\n                default:\r\n                    cpuFamilyResult.IsValid = false;\r\n                    cpuFamilyResult.Message = \"Unsupported CPU category. Manufacturer: \" + manufacturer + \", Architecture: \" + processorArchitecture + \", CPUFamily: \" + sysInfo.ProcessorLevel + \", ProcessorRevision: \" + sysInfo.ProcessorRevision;\r\n                    break;\r\n            }\r\n            return cpuFamilyResult;\r\n        }\r\n    }\r\n\"@\r\n\r\n        # Storage\r\n        try {\r\n            $osDrive = Get-CimInstance -Class Win32_OperatingSystem | Select-Object -Property SystemDrive\r\n            $osDriveSize = Get-CimInstance -Class Win32_LogicalDisk -Filter \"DeviceID='$($osDrive.SystemDrive)'\" | Select-Object @{Name = \"SizeGB\"; Expression = { $_.Size \/ 1GB -as [int] } }  \r\n\r\n            if ($null -eq $osDriveSize) {\r\n                UpdateReturnCode -ReturnCode 1\r\n                $outObject.returnReason += $logFormatReturnReason -f $STORAGE_STRING\r\n                $outObject.logging += $logFormatWithBlob -f $STORAGE_STRING, \"Storage is null\", $FAIL_STRING\r\n                $exitCode = 1\r\n            }\r\n            elseif ($osDriveSize.SizeGB -lt $MinOSDiskSizeGB) {\r\n                UpdateReturnCode -ReturnCode 1\r\n                $outObject.returnReason += $logFormatReturnReason -f $STORAGE_STRING\r\n                $outObject.logging += $logFormatWithUnit -f $STORAGE_STRING, $OS_DISK_SIZE_STRING, ($osDriveSize.SizeGB), $GB_UNIT_STRING, $FAIL_STRING\r\n                $exitCode = 1\r\n            }\r\n            else {\r\n                $outObject.logging += $logFormatWithUnit -f $STORAGE_STRING, $OS_DISK_SIZE_STRING, ($osDriveSize.SizeGB), $GB_UNIT_STRING, $PASS_STRING\r\n                UpdateReturnCode -ReturnCode 0\r\n            }\r\n        }\r\n        catch {\r\n            UpdateReturnCode -ReturnCode -1\r\n            $outObject.logging += $logFormat -f $STORAGE_STRING, $OS_DISK_SIZE_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n            $outObject.logging += $logFormatException -f \"$($_.Exception.GetType().Name) $($_.Exception.Message)\"\r\n            $exitCode = 1\r\n        }\r\n\r\n        # Memory (bytes)\r\n        try {\r\n            $memory = Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property Capacity -Sum | Select-Object @{Name = \"SizeGB\"; Expression = { $_.Sum \/ 1GB -as [int] } }\r\n\r\n            if ($null -eq $memory) {\r\n                UpdateReturnCode -ReturnCode 1\r\n                $outObject.returnReason += $logFormatReturnReason -f $MEMORY_STRING\r\n                $outObject.logging += $logFormatWithBlob -f $MEMORY_STRING, \"Memory is null\", $FAIL_STRING\r\n                $exitCode = 1\r\n            }\r\n            elseif ($memory.SizeGB -lt $MinMemoryGB) {\r\n                UpdateReturnCode -ReturnCode 1\r\n                $outObject.returnReason += $logFormatReturnReason -f $MEMORY_STRING\r\n                $outObject.logging += $logFormatWithUnit -f $MEMORY_STRING, $SYSTEM_MEMORY_STRING, ($memory.SizeGB), $GB_UNIT_STRING, $FAIL_STRING\r\n                $exitCode = 1\r\n            }\r\n            else {\r\n                $outObject.logging += $logFormatWithUnit -f $MEMORY_STRING, $SYSTEM_MEMORY_STRING, ($memory.SizeGB), $GB_UNIT_STRING, $PASS_STRING\r\n                UpdateReturnCode -ReturnCode 0\r\n            }\r\n        }\r\n        catch {\r\n            UpdateReturnCode -ReturnCode -1\r\n            $outObject.logging += $logFormat -f $MEMORY_STRING, $SYSTEM_MEMORY_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n            $outObject.logging += $logFormatException -f \"$($_.Exception.GetType().Name) $($_.Exception.Message)\"\r\n            $exitCode = 1\r\n        }\r\n\r\n        # TPM\r\n        try {\r\n            $tpm = Get-Tpm\r\n\r\n            if ($null -eq $tpm) {\r\n                UpdateReturnCode -ReturnCode 1\r\n                $outObject.returnReason += $logFormatReturnReason -f $TPM_STRING\r\n                $outObject.logging += $logFormatWithBlob -f $TPM_STRING, \"TPM is null\", $FAIL_STRING\r\n                $exitCode = 1\r\n            }\r\n            elseif ($tpm.TpmPresent) {\r\n                $tpmVersion = Get-CimInstance -Class Win32_Tpm -Namespace root\\CIMV2\\Security\\MicrosoftTpm | Select-Object -Property SpecVersion\r\n\r\n                if ($null -eq $tpmVersion.SpecVersion) {\r\n                    UpdateReturnCode -ReturnCode 1\r\n                    $outObject.returnReason += $logFormatReturnReason -f $TPM_STRING\r\n                    $outObject.logging += $logFormat -f $TPM_STRING, $TPM_VERSION_STRING, \"null\", $FAIL_STRING\r\n                    $exitCode = 1\r\n                }\r\n\r\n                $majorVersion = $tpmVersion.SpecVersion.Split(\",\")[0] -as [int]\r\n                if ($majorVersion -lt 2) {\r\n                    UpdateReturnCode -ReturnCode 1\r\n                    $outObject.returnReason += $logFormatReturnReason -f $TPM_STRING\r\n                    $outObject.logging += $logFormat -f $TPM_STRING, $TPM_VERSION_STRING, ($tpmVersion.SpecVersion), $FAIL_STRING\r\n                    $exitCode = 1\r\n                }\r\n                else {\r\n                    $outObject.logging += $logFormat -f $TPM_STRING, $TPM_VERSION_STRING, ($tpmVersion.SpecVersion), $PASS_STRING\r\n                    UpdateReturnCode -ReturnCode 0\r\n                }\r\n            }\r\n            else {\r\n                if ($tpm.GetType().Name -eq \"String\") {\r\n                    UpdateReturnCode -ReturnCode -1\r\n                    $outObject.logging += $logFormat -f $TPM_STRING, $TPM_VERSION_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n                    $outObject.logging += $logFormatException -f $tpm\r\n                }\r\n                else {\r\n                    UpdateReturnCode -ReturnCode 1\r\n                    $outObject.returnReason += $logFormatReturnReason -f $TPM_STRING\r\n                    $outObject.logging += $logFormat -f $TPM_STRING, $TPM_VERSION_STRING, ($tpm.TpmPresent), $FAIL_STRING\r\n                }\r\n                $exitCode = 1\r\n            }\r\n        }\r\n        catch {\r\n            UpdateReturnCode -ReturnCode -1\r\n            $outObject.logging += $logFormat -f $TPM_STRING, $TPM_VERSION_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n            $outObject.logging += $logFormatException -f \"$($_.Exception.GetType().Name) $($_.Exception.Message)\"\r\n            $exitCode = 1\r\n        }\r\n\r\n        # CPU Details\r\n        $cpuDetails;\r\n        try {\r\n            $cpuDetails = @(Get-CimInstance -Class Win32_Processor)[0]\r\n\r\n            if ($null -eq $cpuDetails) {\r\n                UpdateReturnCode -ReturnCode 1\r\n                $exitCode = 1\r\n                $outObject.returnReason += $logFormatReturnReason -f $PROCESSOR_STRING\r\n                $outObject.logging += $logFormatWithBlob -f $PROCESSOR_STRING, \"CpuDetails is null\", $FAIL_STRING\r\n            }\r\n            else {\r\n                $processorCheckFailed = $false\r\n\r\n                # AddressWidth\r\n                if ($null -eq $cpuDetails.AddressWidth -or $cpuDetails.AddressWidth -ne $RequiredAddressWidth) {\r\n                    UpdateReturnCode -ReturnCode 1\r\n                    $processorCheckFailed = $true\r\n                    $exitCode = 1\r\n                }\r\n\r\n                # ClockSpeed is in MHz\r\n                if ($null -eq $cpuDetails.MaxClockSpeed -or $cpuDetails.MaxClockSpeed -le $MinClockSpeedMHz) {\r\n                    UpdateReturnCode -ReturnCode 1;\r\n                    $processorCheckFailed = $true\r\n                    $exitCode = 1\r\n                }\r\n\r\n                # Number of Logical Cores\r\n                if ($null -eq $cpuDetails.NumberOfLogicalProcessors -or $cpuDetails.NumberOfLogicalProcessors -lt $MinLogicalCores) {\r\n                    UpdateReturnCode -ReturnCode 1\r\n                    $processorCheckFailed = $true\r\n                    $exitCode = 1\r\n                }\r\n\r\n                # CPU Family\r\n                Add-Type -TypeDefinition $Source\r\n                $cpuFamilyResult = [CpuFamily]::Validate([String]$cpuDetails.Manufacturer, [uint16]$cpuDetails.Architecture)\r\n\r\n                $cpuDetailsLog = \"{AddressWidth=$($cpuDetails.AddressWidth); MaxClockSpeed=$($cpuDetails.MaxClockSpeed); NumberOfLogicalCores=$($cpuDetails.NumberOfLogicalProcessors); Manufacturer=$($cpuDetails.Manufacturer); Caption=$($cpuDetails.Caption); $($cpuFamilyResult.Message)}\"\r\n\r\n                if (!$cpuFamilyResult.IsValid) {\r\n                    UpdateReturnCode -ReturnCode 1\r\n                    $processorCheckFailed = $true\r\n                    $exitCode = 1\r\n                }\r\n\r\n                if ($processorCheckFailed) {\r\n                    $outObject.returnReason += $logFormatReturnReason -f $PROCESSOR_STRING\r\n                    $outObject.logging += $logFormatWithBlob -f $PROCESSOR_STRING, ($cpuDetailsLog), $FAIL_STRING\r\n                }\r\n                else {\r\n                    $outObject.logging += $logFormatWithBlob -f $PROCESSOR_STRING, ($cpuDetailsLog), $PASS_STRING\r\n                    UpdateReturnCode -ReturnCode 0\r\n                }\r\n            }\r\n        }\r\n        catch {\r\n            UpdateReturnCode -ReturnCode -1\r\n            $outObject.logging += $logFormat -f $PROCESSOR_STRING, $PROCESSOR_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n            $outObject.logging += $logFormatException -f \"$($_.Exception.GetType().Name) $($_.Exception.Message)\"\r\n            $exitCode = 1\r\n        }\r\n\r\n        # SecureBoot\r\n        try {\r\n            $isSecureBootEnabled = Confirm-SecureBootUEFI\r\n            $outObject.logging += $logFormatWithBlob -f $SECUREBOOT_STRING, $CAPABLE_STRING, $PASS_STRING\r\n            UpdateReturnCode -ReturnCode 0\r\n        }\r\n        catch [System.PlatformNotSupportedException] {\r\n            # PlatformNotSupportedException \"Cmdlet not supported on this platform.\" - SecureBoot is not supported or is non-UEFI computer.\r\n            UpdateReturnCode -ReturnCode 1\r\n            $outObject.returnReason += $logFormatReturnReason -f $SECUREBOOT_STRING\r\n            $outObject.logging += $logFormatWithBlob -f $SECUREBOOT_STRING, $NOT_CAPABLE_STRING, $FAIL_STRING\r\n            $exitCode = 1\r\n        }\r\n        catch [System.UnauthorizedAccessException] {\r\n            UpdateReturnCode -ReturnCode -1\r\n            $outObject.logging += $logFormatWithBlob -f $SECUREBOOT_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n            $outObject.logging += $logFormatException -f \"$($_.Exception.GetType().Name) $($_.Exception.Message)\"\r\n            $exitCode = 1\r\n        }\r\n        catch {\r\n            UpdateReturnCode -ReturnCode -1\r\n            $outObject.logging += $logFormatWithBlob -f $SECUREBOOT_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n            $outObject.logging += $logFormatException -f \"$($_.Exception.GetType().Name) $($_.Exception.Message)\"\r\n            $exitCode = 1\r\n        }\r\n\r\n        # i7-7820hq CPU\r\n        try {\r\n            $supportedDevices = @('surface studio 2', 'precision 5520')\r\n            $systemInfo = @(Get-CimInstance -Class Win32_ComputerSystem)[0]\r\n\r\n            if ($null -ne $cpuDetails) {\r\n                if ($cpuDetails.Name -match 'i7-7820hq cpu @ 2.90ghz') {\r\n                    $modelOrSKUCheckLog = $systemInfo.Model.Trim()\r\n                    if ($supportedDevices -contains $modelOrSKUCheckLog) {\r\n                        $outObject.logging += $logFormatWithBlob -f $I7_7820HQ_CPU_STRING, $modelOrSKUCheckLog, $PASS_STRING\r\n                        $outObject.returnCode = 0\r\n                        $exitCode = 0\r\n                    }\r\n                }\r\n            }\r\n        }\r\n        catch {\r\n            if ($outObject.returnCode -ne 0) {\r\n                UpdateReturnCode -ReturnCode -1\r\n                $outObject.logging += $logFormatWithBlob -f $I7_7820HQ_CPU_STRING, $UNDETERMINED_STRING, $UNDETERMINED_CAPS_STRING\r\n                $outObject.logging += $logFormatException -f \"$($_.Exception.GetType().Name) $($_.Exception.Message)\"\r\n                $exitCode = 1\r\n            }\r\n        }\r\n\r\n        Switch ($outObject.returnCode) {\r\n\r\n            0 { $outObject.returnResult = $CAPABLE_CAPS_STRING }\r\n            1 { $outObject.returnResult = $NOT_CAPABLE_CAPS_STRING }\r\n            -1 { $outObject.returnResult = $UNDETERMINED_CAPS_STRING }\r\n            -2 { $outObject.returnResult = $FAILED_TO_RUN_STRING }\r\n        }\r\n\r\n        $outObject | ConvertTo-Json -Compress\r\n    }\r\n}\r\nprocess {\r\n    $Result = Get-HardwareReadiness | Select-Object -Unique | ConvertFrom-Json\r\n\r\n    if ($CustomField -and -not [string]::IsNullOrEmpty($CustomField) -and -not [string]::IsNullOrWhiteSpace($CustomField)) {\r\n        Switch ($Result.returnCode) {\r\n            0 { Ninja-Property-Set -Name $CustomField -Value \"Capable\" }\r\n            1 { Ninja-Property-Set -Name $CustomField -Value \"Not Capable\" }\r\n            -1 { Ninja-Property-Set -Name $CustomField -Value \"Undetermined\" }\r\n            -2 { Ninja-Property-Set -Name $CustomField -Value \"Failed To Run\" }\r\n            default { Ninja-Property-Set -Name $CustomField -Value \"Unknown\" }\r\n        }\r\n    }\r\n\r\n    # Print Return Result\r\n    Write-Host \"Result: $($Result.returnResult)\"\r\n    exit $Result.returnCode\r\n}\r\nend {\r\n    \r\n    \r\n    \r\n}<\/pre>\n<p>&nbsp;<\/p>\n\n<div class=\"in-context-cta\"><p>Greifen Sie auf \u00fcber 300 Skripte im NinjaOne Dojo zu.<\/p>\n<p><a href=\"https:\/\/www.ninjaone.com\/freetrialform\/\">Zugang erhalten<\/a><\/p>\n<\/div>\n<h2>Detaillierte Aufschl\u00fcsselung<\/h2>\n<p>Das Skript umfasst mehrere wichtige Schritte:<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Einrichtung der Umgebung<\/strong>: Es beginnt mit der Einrichtung von Parametern und Umgebungsvariablen,und pr\u00fcft, ob ein benutzerdefinierter Feldname angegeben wurde. Danach initialisiert das Skript verschiedene Funktionen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"2\" data-aria-level=\"1\"><strong>Get-HardwareReadiness<\/strong>: Die Kernfunktion des Skripts ist <strong>Get-HardwareReadiness<\/strong>. Diese Funktion pr\u00fcft verschiedene Hardware-Aspekte wie Speicher, Arbeitsspeicher, TPM (Trusted Platform Module), CPU-Details und den Status des sicheren Bootens. Das Skript verwendet PowerShell-Cmdlets wie <strong>Get-CimInstance<\/strong> und benutzerdefinierte Codebl\u00f6cke f\u00fcr detaillierte Pr\u00fcfungen.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"1\"><strong>Logik der Bewertung<\/strong>: F\u00fcr jede Hardwarekomponente pr\u00fcft das Skript, ob das System die Mindestanforderungen f\u00fcr Windows 11 erf\u00fcllt. Zu diesen Pr\u00fcfungen geh\u00f6ren Speichergr\u00f6\u00dfe, Speicherkapazit\u00e4t, TPM-Version, CPU-Architektur und -Geschwindigkeit sowie die F\u00e4higkeit zum sicheren Booten.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"4\" data-aria-level=\"1\"><strong>Ergebnis<\/strong>: Auf der Grundlage dieser Pr\u00fcfungen setzt das Skript einen R\u00fcckgabecode und ein Ergebnis, das &#8218;F\u00e4hig&#8216;, &#8218;Nicht F\u00e4hig&#8216;, &#8218;Unbestimmt&#8216; oder &#8218;Fehlgeschlagen&#8216; sein kann.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"5\" data-aria-level=\"1\"><strong>Zuweisung einem benutzerdefinierten Feld<\/strong>: Wenn ein benutzerdefinierter Feld-Parameter verwendet wird, ordnet das Skript das Ergebnis diesem Feld zu.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"6\" data-aria-level=\"1\"><strong>Ausgabe<\/strong>: Schlie\u00dflich gibt das Skript das Ergebnis aus und beendet sich mit dem entsprechenden R\u00fcckgabecode.<\/li>\n<\/ul>\n<h2>M\u00f6gliche Anwendungsf\u00e4lle<\/h2>\n<p>Ein MSP k\u00f6nnte dieses Skript verwenden, um schnell zu beurteilen, welche Kundenrechner f\u00fcr ein Windows 11-Upgrade bereit sind. Bevor ein MSP beispielsweise ein unternehmensweites Upgrade durchf\u00fchrt, k\u00f6nnte er dieses Skript auf allen Rechnern ausf\u00fchren, um diejenigen zu identifizieren, die ein Hardware-Upgrade ben\u00f6tigen.<\/p>\n<h2>Vergleiche<\/h2>\n<p>Bisher musste man die Kompatibilit\u00e4t des Betriebssystems manuell \u00fcberpr\u00fcfen oder separate Tools verwenden. Dieses Skript fasst diese Pr\u00fcfungen in einem einzigen automatisierten Prozess zusammen und bietet so mehr Effizienz und Genauigkeit als manuelle Methoden.<\/p>\n<h2>FAQs<\/h2>\n<p><strong>Q1: Ist dieses Skript mit allen Windows-Versionen kompatibel? \u00a0<\/strong><br \/>\nA1: Das Skript ist f\u00fcr Windows 10-Systeme und h\u00f6her konzipiert.<\/p>\n<p><strong>Q2: Was passiert, wenn der TPM-Chip nicht vorhanden ist? \u00a0<\/strong><br \/>\nA2: Das Skript gibt den Status &#8218;Nicht F\u00e4hig&#8216; zur\u00fcck, wenn der TPM-Chip fehlt oder nicht kompatibel ist.<\/p>\n<p><strong>Q3: Kann dieses Skript auf mehreren Rechnern gleichzeitig ausgef\u00fchrt werden? \u00a0<\/strong><br \/>\nA3: Ja, es kann in gr\u00f6\u00dfere Automatisierungsabl\u00e4ufe integriert werden und auf mehreren Computern laufen.<\/p>\n<h2>Folgen<\/h2>\n<p>Die Ergebnisse dieses Skripts haben erhebliche Auswirkungen auf die IT-Sicherheit und -Planung. Nicht-konforme Rechner k\u00f6nnen Sicherheitsschwachstellen aufweisen, und die Planung von Hardware-Upgrades ist entscheidend.<\/p>\n<h2>Empfehlungen<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"7\" data-aria-level=\"1\">F\u00fchren Sie dieses Skript regelm\u00e4\u00dfig als Teil der Wartungsroutinen aus.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"8\" data-aria-level=\"1\">Nutzen Sie die Ergebnisse f\u00fcr die strategische Planung von Hardware-Upgrades.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"9\" data-aria-level=\"1\">Integrieren Sie das Skript in umfassendere IT-Management-Workflows, um die Effizienz zu steigern.<\/li>\n<\/ul>\n<h2>Abschlie\u00dfende \u00dcberlegungen<\/h2>\n<p>Die Migration auf neue Betriebssysteme wie Windows 11 ist ein entscheidender Schritt, um IT-Umgebungen auf dem neuesten Stand und sicher zu halten. Tools wie NinjaOne, die <a href=\"https:\/\/www.ninjaone.com\/de\/rmm\/it-automatisierung\/\">IT-Management-Prozesse rationalisieren und automatisieren<\/a>, sind in diesem Zusammenhang von unsch\u00e4tzbarem Wert. Mit Skripten wie dem hier vorgestellten k\u00f6nnen MSPs und IT-Expert:innen einen reibungslosen, effizienten \u00dcbergang zu Windows 11 gew\u00e4hrleisten und daf\u00fcr sorgen, dass die Systeme sicher und auf dem neuesten Stand sind.<\/p>\n","protected":false},"author":35,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","_lmt_disableupdate":"no","_lmt_disable":""},"operating_system":[4212],"use_cases":[4385],"class_list":["post-420619","script_hub","type-script_hub","status-publish","hentry","script_hub_category-windows"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/script_hub\/420619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/comments?post=420619"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/media?parent=420619"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/operating_system?post=420619"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/de\/wp-json\/wp\/v2\/use_cases?post=420619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}