├── README.md ├── Java Solution Guide └── Current_Java Solution.zip ├── CCMSetup Error Monitoring ├── CCMSetup Errors.pbit ├── KQL - Query return code counts by day (for trending).kql ├── KQL - Query failure return codes over time (for trending).kql ├── KQL - Query sucess return codes over time (for trending).kql ├── KQL - Query most recent return code per device.kql ├── KQL - Query most recent log entries per device.kql └── Post-CCMSetupReturnCodeAndLogEntries.ps1 ├── PowerBI Templates ├── MEM Managed Devices Report.pbit ├── Intune Managed Devices Report.pbit ├── MEMCM Client Content Downloads.pbit ├── ConfigMgr Client Connectivity Status.pbit ├── Windows 10 Feature Updates Compliance.pbit ├── Windows 10 Feature Updates Readiness.pbit ├── Windows 10 Feature Updates Compliance (No DA).pbit ├── 20H1_AppCompat.mof ├── 21H1_AppCompat.mof └── Configuration.mof.additions ├── Compliance Items └── Enforce Point and Print Restrictions │ ├── Remediate.ps1 │ └── Detect.ps1 ├── PowerShell Scripts ├── Compliance Settings │ ├── Microsoft Office Templates │ │ ├── Deploying Custom Microsoft Office Templates with System Center Configuration Manager.pdf │ │ ├── Machine Setting │ │ │ ├── Discovery.ps1 │ │ │ └── Remediation.ps1 │ │ └── User Setting │ │ │ ├── Discovery.ps1 │ │ │ └── Remediation.ps1 │ └── LocalAdministratorInfo │ │ ├── Discovery.ps1 │ │ └── Remediation.ps1 └── Get-CMSelectedSoftwareContentSizes.ps1 ├── CMG Monitoring ├── Send-CMGTaskFailureAlert.ps1 ├── Send-CMGMonitoringAlert.ps1 ├── Check-CMGConnectedClientCount.ps1 ├── Check-CMGConnectionPointStatus.ps1 └── Check-CMGStatus.ps1 ├── Windows 11 Compatibility ├── CO21H2_AppCompatCM.mof ├── CO21H2_AppCompat.mof ├── Create-MEMCMW11CompatibilityCollections.ps1 └── configuration_additions.mof ├── Windows 11 22H2 Compatibility ├── NI22H2_AppCompatCM.mof ├── NI22H2_AppCompat.mof ├── Create-MEMCMW1122H2CompatibilityCollections.ps1 └── configuration_additions.mof └── Client Health Summary Report └── New-CMClientHealthSummaryReport.ps1 /README.md: -------------------------------------------------------------------------------- 1 | # ConfigMgr 2 | Microsoft Endpoint Configuration Manager related scripts and documents 3 | -------------------------------------------------------------------------------- /Java Solution Guide/Current_Java Solution.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/Java Solution Guide/Current_Java Solution.zip -------------------------------------------------------------------------------- /CCMSetup Error Monitoring/CCMSetup Errors.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/CCMSetup Error Monitoring/CCMSetup Errors.pbit -------------------------------------------------------------------------------- /PowerBI Templates/MEM Managed Devices Report.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerBI Templates/MEM Managed Devices Report.pbit -------------------------------------------------------------------------------- /PowerBI Templates/Intune Managed Devices Report.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerBI Templates/Intune Managed Devices Report.pbit -------------------------------------------------------------------------------- /PowerBI Templates/MEMCM Client Content Downloads.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerBI Templates/MEMCM Client Content Downloads.pbit -------------------------------------------------------------------------------- /PowerBI Templates/ConfigMgr Client Connectivity Status.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerBI Templates/ConfigMgr Client Connectivity Status.pbit -------------------------------------------------------------------------------- /PowerBI Templates/Windows 10 Feature Updates Compliance.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerBI Templates/Windows 10 Feature Updates Compliance.pbit -------------------------------------------------------------------------------- /PowerBI Templates/Windows 10 Feature Updates Readiness.pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerBI Templates/Windows 10 Feature Updates Readiness.pbit -------------------------------------------------------------------------------- /PowerBI Templates/Windows 10 Feature Updates Compliance (No DA).pbit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerBI Templates/Windows 10 Feature Updates Compliance (No DA).pbit -------------------------------------------------------------------------------- /CCMSetup Error Monitoring/KQL - Query return code counts by day (for trending).kql: -------------------------------------------------------------------------------- 1 | CM_CCMSetupReturnCodes_CL 2 | | where ReturnCode_s !in (0,7) and isnotempty(ReturnCode_s) 3 | | summarize Count=count() by bin(TimeGenerated,1d),ReturnCode=ReturnCode_s 4 | | order by TimeGenerated desc -------------------------------------------------------------------------------- /Compliance Items/Enforce Point and Print Restrictions/Remediate.ps1: -------------------------------------------------------------------------------- 1 | $RegKey = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint" 2 | Set-ItemProperty -Path $RegKey -Name NoWarningNoElevationOnInstall -Value 0 -Force 3 | Set-ItemProperty -Path $RegKey -Name UpdatePromptSettings -Value 0 -Force -------------------------------------------------------------------------------- /PowerShell Scripts/Compliance Settings/Microsoft Office Templates/Deploying Custom Microsoft Office Templates with System Center Configuration Manager.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SMSAgentSoftware/ConfigMgr/HEAD/PowerShell Scripts/Compliance Settings/Microsoft Office Templates/Deploying Custom Microsoft Office Templates with System Center Configuration Manager.pdf -------------------------------------------------------------------------------- /CCMSetup Error Monitoring/KQL - Query failure return codes over time (for trending).kql: -------------------------------------------------------------------------------- 1 | CM_CCMSetupReturnCodes_CL 2 | | summarize arg_max(TimeGenerated,*) by AADDeviceID_g 3 | | where ReturnCode_s !in (0,7) 4 | | where datetime_diff('day',now(),Date_t) <= 60 5 | | summarize Count=count() by bin(TimeGenerated,1d),ReturnCode=ReturnCode_s,ReturnCodeDate=Date_t 6 | | summarize Count=count() by bin(ReturnCodeDate,1d),ReturnCode 7 | | order by ReturnCodeDate desc -------------------------------------------------------------------------------- /CCMSetup Error Monitoring/KQL - Query sucess return codes over time (for trending).kql: -------------------------------------------------------------------------------- 1 | CM_CCMSetupReturnCodes_CL 2 | | summarize arg_max(TimeGenerated,*) by AADDeviceID_g 3 | | where ReturnCode_s in (0,7) 4 | | where datetime_diff('day',now(),Date_t) <= 60 5 | | summarize Count=count() by bin(TimeGenerated,1d),ReturnCode=ReturnCode_s,ReturnCodeDate=Date_t 6 | | summarize Count=count() by bin(ReturnCodeDate,1d),ReturnCode 7 | | order by ReturnCodeDate desc -------------------------------------------------------------------------------- /CCMSetup Error Monitoring/KQL - Query most recent return code per device.kql: -------------------------------------------------------------------------------- 1 | CM_CCMSetupReturnCodes_CL 2 | | summarize arg_max(TimeGenerated,*) by AADDeviceID_g 3 | | project 4 | ComputerName=ComputerName_s, 5 | AADDeviceID=AADDeviceID_g, 6 | ReturnCode=ReturnCode_s, 7 | Date=Date_t, 8 | ReturnCodeAge_Days=datetime_diff('day',now(),Date_t), 9 | TimeGenerated, 10 | DataFreshness_Days=datetime_diff('day',now(),TimeGenerated) 11 | -------------------------------------------------------------------------------- /PowerShell Scripts/Compliance Settings/LocalAdministratorInfo/Discovery.ps1: -------------------------------------------------------------------------------- 1 | Try 2 | { 3 | [datetime]$Date = (Get-ItemProperty -Path HKLM:\SOFTWARE\IT_Local\LocalAdminInfo -Name LastUpdated -ErrorAction Stop).LastUpdated 4 | } 5 | Catch 6 | { 7 | "Error" 8 | Break 9 | } 10 | 11 | # If script was last run less than 15 minutes ago, report compliant 12 | If ($Date -ge (Get-Date).AddMinutes(-15)) 13 | { 14 | "Compliant" 15 | } 16 | Else 17 | { 18 | "Not-Compliant" 19 | } -------------------------------------------------------------------------------- /CCMSetup Error Monitoring/KQL - Query most recent log entries per device.kql: -------------------------------------------------------------------------------- 1 | CM_CCMSetupErrorLog_CL 2 | | top-nested of AADDeviceID=AADDeviceID_g by temp=max(1), 3 | top-nested 1 of DatePosted=DatePosted_t by temp1=max(DatePosted_t), 4 | top-nested of LogText=LogText_s by temp2=max(1), 5 | top-nested of DateTime=DateTime_t by temp3=max(1), 6 | top-nested of component=component_s by temp4=max(1), 7 | top-nested of type=type_d by temp5=max(1), 8 | top-nested of thread=thread_d by temp6=max(1), 9 | top-nested of file=file_s by temp7=max(1), 10 | top-nested of LineNumber=LineNumber_d by temp8=max(1), 11 | top-nested of ComputerName=ComputerName_s by temp9=max(1), 12 | top-nested of context=context_s by temp10=max(1) 13 | | project-away temp* 14 | | order by LineNumber desc -------------------------------------------------------------------------------- /Compliance Items/Enforce Point and Print Restrictions/Detect.ps1: -------------------------------------------------------------------------------- 1 | $RegKey = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint" 2 | $RegValues = Get-Item $RegKey -ErrorAction SilentlyContinue 3 | If ($null -eq $RegValues) 4 | { 5 | Write-host "Compliant" 6 | } 7 | else 8 | { 9 | try 10 | { 11 | $NoWarningNoElevationOnInstall = $RegValues.GetValue('NoWarningNoElevationOnInstall') 12 | $UpdatePromptSettings = $RegValues.GetValue('UpdatePromptSettings') 13 | } 14 | catch {} 15 | If (($null -eq $NoWarningNoElevationOnInstall -or $NoWarningNoElevationOnInstall -eq 0) -and ($null -eq $UpdatePromptSettings -or $UpdatePromptSettings -eq 0)) 16 | { 17 | Write-Host "Compliant" 18 | } 19 | else 20 | { 21 | Write-Host "Not compliant" 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /CMG Monitoring/Send-CMGTaskFailureAlert.ps1: -------------------------------------------------------------------------------- 1 | Param($Message) 2 | $ServiceConnectionPointName = '' 3 | # Email params 4 | $EmailParams = @{ 5 | To = '' 6 | From = '' 7 | Smtpserver = '.mail.protection.outlook.com' # direct send 8 | Port = 25 9 | Subject = "CMG Maintenance Task Failure" 10 | } 11 | 12 | $Body = @" 13 | 14 | 15 | 16 | The ConfigMgr Service Monitor reports a failed maintenance task on the Cloud Management Gateway:
17 | $Message 18 |

19 | Recommended action: Check the CloudMgr.log and the *CMGService.logs on $ServiceConnectionPointName at ..\SMS\Logs for more details.

20 |

21 | Recommended action: Run the Connection Analyzer from the Console at Administration > Cloud Services > Cloud Management Gateway and restart the CMG service if necessary.

22 |

23 | Recommended action: Check the health status of the VM scale set instances in the Azure portal.

24 | 25 | 26 | "@ 27 | 28 | Send-MailMessage @EmailParams -Body $Body -BodyAsHtml -Priority High -------------------------------------------------------------------------------- /CMG Monitoring/Send-CMGMonitoringAlert.ps1: -------------------------------------------------------------------------------- 1 | Param($Message) 2 | $ServiceConnectionPointName = '' 3 | # Email params 4 | $EmailParams = @{ 5 | To = '' 6 | From = '' 7 | Smtpserver = '.mail.protection.outlook.com' # direct send 8 | Port = 25 9 | Subject = "CMG Monitoring Alert" 10 | } 11 | 12 | $Body = @" 13 | 14 | 15 | 16 | The ConfigMgr Service Monitor received an exception while monitoring the status of the Cloud Management Gateway:
17 | $Message 18 |

19 | Recommended action: Check the CloudMgr.log and the *CMGService.logs on $ServiceConnectionPointName at ..\SMS\Logs for more details.

20 |

21 | Recommended action: Run the Connection Analyzer from the Console at Administration > Cloud Services > Cloud Management Gateway and restart the CMG service if necessary.

22 |

23 | Recommended action: Check the health status of the VM scale set instances in the Azure portal.

24 | 25 | 26 | "@ 27 | 28 | Send-MailMessage @EmailParams -Body $Body -BodyAsHtml -Priority High -------------------------------------------------------------------------------- /Windows 11 Compatibility/CO21H2_AppCompatCM.mof: -------------------------------------------------------------------------------- 1 | // RegKeyToMOF by Mark Cochrane (with help from Skissinger, SteveRac, Jonas Hettich, Kent Agerlund & Barker) 2 | // this section tells the inventory agent what to report to the server 3 | // 07/10/2021 11:20:12 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2\\SMS") 6 | #pragma deleteclass("COTwentyOneHTwoCM", NOFAIL) 7 | [SMS_Report(TRUE),SMS_Group_Name("COTwentyOneHTwoCM"),SMS_Class_ID("COTwentyOneHTwoCM")] 8 | Class COTwentyOneHTwoCM: SMS_Class_Template 9 | { 10 | [SMS_Report(TRUE),key] string KeyName; 11 | [SMS_Report(TRUE)] String BlockedByBdd; 12 | [SMS_Report(TRUE)] String BlockedByBios; 13 | [SMS_Report(TRUE)] String BlockedByCloverTrail; 14 | [SMS_Report(TRUE)] String BlockedByComputerHardwareId; 15 | [SMS_Report(TRUE)] String BlockedByCpu; 16 | [SMS_Report(TRUE)] String BlockedByCpuFms; 17 | [SMS_Report(TRUE)] String BlockedByDeviceBlock; 18 | [SMS_Report(TRUE)] String BlockedByHardDiskController; 19 | [SMS_Report(TRUE)] String BlockedByMemory; 20 | [SMS_Report(TRUE)] String BlockedByNetwork; 21 | [SMS_Report(TRUE)] String BlockedBySModeState; 22 | [SMS_Report(TRUE)] String BlockedBySystemDriveSize; 23 | [SMS_Report(TRUE)] String BlockedBySystemDriveTooFull; 24 | [SMS_Report(TRUE)] String BlockedByTpmVersion; 25 | [SMS_Report(TRUE)] String BlockedByUefiSecureBoot; 26 | [SMS_Report(TRUE)] String BlockedByUpgradableBios; 27 | [SMS_Report(TRUE)] String Dx12SupportedDevice; 28 | [SMS_Report(TRUE)] String RAV; 29 | [SMS_Report(TRUE)] String Guest; 30 | [SMS_Report(TRUE)] String MediaCenterInUse; 31 | [SMS_Report(TRUE)] String UexRatingOrange; 32 | [SMS_Report(TRUE)] String UexRatingRed; 33 | [SMS_Report(TRUE)] String UexRatingYellow; 34 | [SMS_Report(TRUE)] String UexUsageRatingOrange; 35 | [SMS_Report(TRUE)] String UexUsageRatingYellow; 36 | [SMS_Report(TRUE)] String Version; 37 | [SMS_Report(TRUE)] String TimestampEpochString; 38 | [SMS_Report(TRUE)] Uint64 Timestamp; 39 | }; -------------------------------------------------------------------------------- /Windows 11 22H2 Compatibility/NI22H2_AppCompatCM.mof: -------------------------------------------------------------------------------- 1 | // RegKeyToMOF by Mark Cochrane (with help from Skissinger, SteveRac, Jonas Hettich, Kent Agerlund & Barker) 2 | // this section tells the inventory agent what to report to the server 3 | // 07/10/2021 11:20:12 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2\\SMS") 6 | #pragma deleteclass("NITwentyTwoHTwoCM", NOFAIL) 7 | [SMS_Report(TRUE),SMS_Group_Name("NITwentyTwoHTwoCM"),SMS_Class_ID("NITwentyTwoHTwoCM")] 8 | Class NITwentyTwoHTwoCM: SMS_Class_Template 9 | { 10 | [SMS_Report(TRUE),key] string KeyName; 11 | [SMS_Report(TRUE)] String BlockedByBdd; 12 | [SMS_Report(TRUE)] String BlockedByBios; 13 | [SMS_Report(TRUE)] String BlockedByCloverTrail; 14 | [SMS_Report(TRUE)] String BlockedByComputerHardwareId; 15 | [SMS_Report(TRUE)] String BlockedByCpu; 16 | [SMS_Report(TRUE)] String BlockedByCpuFms; 17 | [SMS_Report(TRUE)] String BlockedByDeviceBlock; 18 | [SMS_Report(TRUE)] String BlockedByHardDiskController; 19 | [SMS_Report(TRUE)] String BlockedByMemory; 20 | [SMS_Report(TRUE)] String BlockedByNetwork; 21 | [SMS_Report(TRUE)] String BlockedBySModeState; 22 | [SMS_Report(TRUE)] String BlockedBySystemDriveSize; 23 | [SMS_Report(TRUE)] String BlockedBySystemDriveTooFull; 24 | [SMS_Report(TRUE)] String BlockedByTpmVersion; 25 | [SMS_Report(TRUE)] String BlockedByUefiSecureBoot; 26 | [SMS_Report(TRUE)] String BlockedByUpgradableBios; 27 | [SMS_Report(TRUE)] String Dx12SupportedDevice; 28 | [SMS_Report(TRUE)] String RAV; 29 | [SMS_Report(TRUE)] String Guest; 30 | [SMS_Report(TRUE)] String MediaCenterInUse; 31 | [SMS_Report(TRUE)] String UexRatingOrange; 32 | [SMS_Report(TRUE)] String UexRatingRed; 33 | [SMS_Report(TRUE)] String UexRatingYellow; 34 | [SMS_Report(TRUE)] String UexUsageRatingOrange; 35 | [SMS_Report(TRUE)] String UexUsageRatingYellow; 36 | [SMS_Report(TRUE)] String Version; 37 | [SMS_Report(TRUE)] String TimestampEpochString; 38 | [SMS_Report(TRUE)] Uint64 Timestamp; 39 | }; -------------------------------------------------------------------------------- /PowerBI Templates/20H1_AppCompat.mof: -------------------------------------------------------------------------------- 1 | // RegKeyToMOF by Mark Cochrane (with help from Skissinger, SteveRac, Jonas Hettich, Kent Agerlund & Barker) 2 | // this section tells the inventory agent what to report to the server 3 | // 24/11/2020 12:01:19 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2\\SMS") 6 | #pragma deleteclass("TwentyHOne", NOFAIL) 7 | [SMS_Report(TRUE),SMS_Group_Name("TwentyHOne"),SMS_Class_ID("TwentyHOne")] 8 | Class TwentyHOne: SMS_Class_Template 9 | { 10 | [SMS_Report(TRUE),key] string KeyName; 11 | [SMS_Report(FALSE)] String DX12; 12 | [SMS_Report(FALSE)] String GStatus; 13 | [SMS_Report(TRUE)] String GatedBlockId[]; 14 | [SMS_Report(TRUE)] String GatedBlockReason[]; 15 | [SMS_Report(FALSE)] String Guest; 16 | [SMS_Report(FALSE)] String MCE; 17 | [SMS_Report(TRUE)] String RedReason[]; 18 | [SMS_Report(TRUE)] String UpgEx; 19 | [SMS_Report(TRUE)] String UpgExU; 20 | [SMS_Report(TRUE)] String DataExpDate; 21 | [SMS_Report(FALSE)] String DataExpDateEpoch; 22 | [SMS_Report(TRUE)] String DataRelDate; 23 | [SMS_Report(FALSE)] String DataRelDateEpoch; 24 | [SMS_Report(FALSE)] String OemPref; 25 | [SMS_Report(FALSE)] String SdbVer; 26 | [SMS_Report(TRUE)] String Version; 27 | [SMS_Report(FALSE)] String WIP; 28 | [SMS_Report(TRUE)] String AppraiserVersion; 29 | [SMS_Report(FALSE)] String Bat; 30 | [SMS_Report(FALSE)] String Bios; 31 | [SMS_Report(FALSE)] String BootSect; 32 | [SMS_Report(FALSE)] String ComfUp; 33 | [SMS_Report(FALSE)] String Comm; 34 | [SMS_Report(FALSE)] String Fam; 35 | [SMS_Report(FALSE)] String Fing; 36 | [SMS_Report(FALSE)] String Free; 37 | [SMS_Report(FALSE)] String Gamer; 38 | [SMS_Report(FALSE)] String GenTelRunTimestamp; 39 | [SMS_Report(FALSE)] String Genuine; 40 | [SMS_Report(FALSE)] String ISVM; 41 | [SMS_Report(FALSE)] String InboxDataVersion; 42 | [SMS_Report(FALSE)] String Mic; 43 | [SMS_Report(FALSE)] String OEM; 44 | [SMS_Report(FALSE)] String Office; 45 | [SMS_Report(FALSE)] String Paper; 46 | [SMS_Report(TRUE)] String Perf; 47 | [SMS_Report(FALSE)] String Proc; 48 | [SMS_Report(TRUE)] String SystemDriveTooFull; 49 | [SMS_Report(FALSE)] String Touch; 50 | [SMS_Report(TRUE)] String DataVer; 51 | [SMS_Report(TRUE)] String DataVerRecommended; 52 | [SMS_Report(TRUE)] String FailedPrereqs[]; 53 | [SMS_Report(FALSE)] String TimestampEpochString; 54 | [SMS_Report(FALSE)] Uint64 Timestamp; 55 | }; -------------------------------------------------------------------------------- /PowerBI Templates/21H1_AppCompat.mof: -------------------------------------------------------------------------------- 1 | // RegKeyToMOF by Mark Cochrane (with help from Skissinger, SteveRac, Jonas Hettich, Kent Agerlund & Barker) 2 | // this section tells the inventory agent what to report to the server 3 | // 24/11/2020 12:01:19 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2\\SMS") 6 | #pragma deleteclass("TwentyOneHOne", NOFAIL) 7 | [SMS_Report(TRUE),SMS_Group_Name("TwentyOneHOne"),SMS_Class_ID("TwentyOneHOne")] 8 | Class TwentyOneHOne: SMS_Class_Template 9 | { 10 | [SMS_Report(TRUE),key] string KeyName; 11 | [SMS_Report(FALSE)] String DX12; 12 | [SMS_Report(FALSE)] String GStatus; 13 | [SMS_Report(TRUE)] String GatedBlockId[]; 14 | [SMS_Report(TRUE)] String GatedBlockReason[]; 15 | [SMS_Report(FALSE)] String Guest; 16 | [SMS_Report(FALSE)] String MCE; 17 | [SMS_Report(TRUE)] String RedReason[]; 18 | [SMS_Report(TRUE)] String UpgEx; 19 | [SMS_Report(TRUE)] String UpgExU; 20 | [SMS_Report(TRUE)] String DataExpDate; 21 | [SMS_Report(FALSE)] String DataExpDateEpoch; 22 | [SMS_Report(TRUE)] String DataRelDate; 23 | [SMS_Report(FALSE)] String DataRelDateEpoch; 24 | [SMS_Report(FALSE)] String OemPref; 25 | [SMS_Report(FALSE)] String SdbVer; 26 | [SMS_Report(TRUE)] String Version; 27 | [SMS_Report(FALSE)] String WIP; 28 | [SMS_Report(TRUE)] String AppraiserVersion; 29 | [SMS_Report(FALSE)] String Bat; 30 | [SMS_Report(FALSE)] String Bios; 31 | [SMS_Report(FALSE)] String BootSect; 32 | [SMS_Report(FALSE)] String ComfUp; 33 | [SMS_Report(FALSE)] String Comm; 34 | [SMS_Report(FALSE)] String Fam; 35 | [SMS_Report(FALSE)] String Fing; 36 | [SMS_Report(FALSE)] String Free; 37 | [SMS_Report(FALSE)] String Gamer; 38 | [SMS_Report(FALSE)] String GenTelRunTimestamp; 39 | [SMS_Report(FALSE)] String Genuine; 40 | [SMS_Report(FALSE)] String ISVM; 41 | [SMS_Report(FALSE)] String InboxDataVersion; 42 | [SMS_Report(FALSE)] String Mic; 43 | [SMS_Report(FALSE)] String OEM; 44 | [SMS_Report(FALSE)] String Office; 45 | [SMS_Report(FALSE)] String Paper; 46 | [SMS_Report(TRUE)] String Perf; 47 | [SMS_Report(FALSE)] String Proc; 48 | [SMS_Report(TRUE)] String SystemDriveTooFull; 49 | [SMS_Report(FALSE)] String Touch; 50 | [SMS_Report(TRUE)] String DataVer; 51 | [SMS_Report(TRUE)] String DataVerRecommended; 52 | [SMS_Report(TRUE)] String FailedPrereqs[]; 53 | [SMS_Report(FALSE)] String TimestampEpochString; 54 | [SMS_Report(FALSE)] Uint64 Timestamp; 55 | }; -------------------------------------------------------------------------------- /Windows 11 Compatibility/CO21H2_AppCompat.mof: -------------------------------------------------------------------------------- 1 | // RegKeyToMOF by Mark Cochrane (with help from Skissinger, SteveRac, Jonas Hettich, Kent Agerlund & Barker) 2 | // this section tells the inventory agent what to report to the server 3 | // 24/11/2020 12:01:19 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2\\SMS") 6 | #pragma deleteclass("COTwentyOneHTwo", NOFAIL) 7 | [SMS_Report(TRUE),SMS_Group_Name("COTwentyOneHTwo"),SMS_Class_ID("COTwentyOneHTwo")] 8 | Class COTwentyOneHTwo: SMS_Class_Template 9 | { 10 | [SMS_Report(TRUE),key] string KeyName; 11 | [SMS_Report(FALSE)] String DX12; 12 | [SMS_Report(FALSE)] String GStatus; 13 | [SMS_Report(TRUE)] String GatedBlockId[]; 14 | [SMS_Report(TRUE)] String GatedBlockReason[]; 15 | [SMS_Report(FALSE)] String Guest; 16 | [SMS_Report(FALSE)] String MCE; 17 | [SMS_Report(TRUE)] String RedReason[]; 18 | [SMS_Report(TRUE)] String UpgEx; 19 | [SMS_Report(TRUE)] String UpgExU; 20 | [SMS_Report(TRUE)] String DataExpDate; 21 | [SMS_Report(FALSE)] String DataExpDateEpoch; 22 | [SMS_Report(TRUE)] String DataRelDate; 23 | [SMS_Report(FALSE)] String DataRelDateEpoch; 24 | [SMS_Report(FALSE)] String OemPref; 25 | [SMS_Report(FALSE)] String SdbVer; 26 | [SMS_Report(TRUE)] String Version; 27 | [SMS_Report(FALSE)] String WIP; 28 | [SMS_Report(TRUE)] String AppraiserVersion; 29 | [SMS_Report(FALSE)] String Bat; 30 | [SMS_Report(FALSE)] String Bios; 31 | [SMS_Report(FALSE)] String BootSect; 32 | [SMS_Report(FALSE)] String ComfUp; 33 | [SMS_Report(FALSE)] String Comm; 34 | [SMS_Report(FALSE)] String Fam; 35 | [SMS_Report(FALSE)] String Fing; 36 | [SMS_Report(FALSE)] String Free; 37 | [SMS_Report(FALSE)] String Gamer; 38 | [SMS_Report(FALSE)] String GenTelRunTimestamp; 39 | [SMS_Report(FALSE)] String Genuine; 40 | [SMS_Report(FALSE)] String ISVM; 41 | [SMS_Report(FALSE)] String InboxDataVersion; 42 | [SMS_Report(FALSE)] String Mic; 43 | [SMS_Report(FALSE)] String OEM; 44 | [SMS_Report(FALSE)] String Office; 45 | [SMS_Report(FALSE)] String Paper; 46 | [SMS_Report(TRUE)] String Perf; 47 | [SMS_Report(FALSE)] String Proc; 48 | [SMS_Report(TRUE)] String SystemDriveTooFull; 49 | [SMS_Report(FALSE)] String Touch; 50 | [SMS_Report(TRUE)] String DataVer; 51 | [SMS_Report(TRUE)] String DataVerRecommended; 52 | [SMS_Report(TRUE)] String FailedPrereqs[]; 53 | [SMS_Report(FALSE)] String TimestampEpochString; 54 | [SMS_Report(FALSE)] Uint64 Timestamp; 55 | }; -------------------------------------------------------------------------------- /Windows 11 22H2 Compatibility/NI22H2_AppCompat.mof: -------------------------------------------------------------------------------- 1 | // RegKeyToMOF by Mark Cochrane (with help from Skissinger, SteveRac, Jonas Hettich, Kent Agerlund & Barker) 2 | // this section tells the inventory agent what to report to the server 3 | // 24/11/2020 12:01:19 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2\\SMS") 6 | #pragma deleteclass("NITwentyTwoHTwo", NOFAIL) 7 | [SMS_Report(TRUE),SMS_Group_Name("NITwentyTwoHTwo"),SMS_Class_ID("NITwentyTwoHTwo")] 8 | Class NITwentyTwoHTwo: SMS_Class_Template 9 | { 10 | [SMS_Report(TRUE),key] string KeyName; 11 | [SMS_Report(FALSE)] String DX12; 12 | [SMS_Report(FALSE)] String GStatus; 13 | [SMS_Report(TRUE)] String GatedBlockId[]; 14 | [SMS_Report(TRUE)] String GatedBlockReason[]; 15 | [SMS_Report(FALSE)] String Guest; 16 | [SMS_Report(FALSE)] String MCE; 17 | [SMS_Report(TRUE)] String RedReason[]; 18 | [SMS_Report(TRUE)] String UpgEx; 19 | [SMS_Report(TRUE)] String UpgExU; 20 | [SMS_Report(TRUE)] String DataExpDate; 21 | [SMS_Report(FALSE)] String DataExpDateEpoch; 22 | [SMS_Report(TRUE)] String DataRelDate; 23 | [SMS_Report(FALSE)] String DataRelDateEpoch; 24 | [SMS_Report(FALSE)] String OemPref; 25 | [SMS_Report(FALSE)] String SdbVer; 26 | [SMS_Report(TRUE)] String Version; 27 | [SMS_Report(FALSE)] String WIP; 28 | [SMS_Report(TRUE)] String AppraiserVersion; 29 | [SMS_Report(FALSE)] String Bat; 30 | [SMS_Report(FALSE)] String Bios; 31 | [SMS_Report(FALSE)] String BootSect; 32 | [SMS_Report(FALSE)] String ComfUp; 33 | [SMS_Report(FALSE)] String Comm; 34 | [SMS_Report(FALSE)] String Fam; 35 | [SMS_Report(FALSE)] String Fing; 36 | [SMS_Report(FALSE)] String Free; 37 | [SMS_Report(FALSE)] String Gamer; 38 | [SMS_Report(FALSE)] String GenTelRunTimestamp; 39 | [SMS_Report(FALSE)] String Genuine; 40 | [SMS_Report(FALSE)] String ISVM; 41 | [SMS_Report(FALSE)] String InboxDataVersion; 42 | [SMS_Report(FALSE)] String Mic; 43 | [SMS_Report(FALSE)] String OEM; 44 | [SMS_Report(FALSE)] String Office; 45 | [SMS_Report(FALSE)] String Paper; 46 | [SMS_Report(TRUE)] String Perf; 47 | [SMS_Report(FALSE)] String Proc; 48 | [SMS_Report(TRUE)] String SystemDriveTooFull; 49 | [SMS_Report(FALSE)] String Touch; 50 | [SMS_Report(TRUE)] String DataVer; 51 | [SMS_Report(TRUE)] String DataVerRecommended; 52 | [SMS_Report(TRUE)] String FailedPrereqs[]; 53 | [SMS_Report(FALSE)] String TimestampEpochString; 54 | [SMS_Report(FALSE)] Uint64 Timestamp; 55 | }; -------------------------------------------------------------------------------- /CMG Monitoring/Check-CMGConnectedClientCount.ps1: -------------------------------------------------------------------------------- 1 | ############ 2 | ## PARAMS ## 3 | ############ 4 | [int]$CMGClientCountThreshold = 20 # The minimum number of CMG-connected clients before an alert is triggered 5 | $script:dataSource = '' # ConfigMgr database server 6 | $script:database = 'CM_XXX'# ConfigMgr database name 7 | $ServiceConnectionPointName = '' 8 | $EmailParams = @{ 9 | To = '' 10 | From = '' 11 | Smtpserver = '.mail.protection.outlook.com' # direct send 12 | Port = 25 13 | Subject = "Low CMG Client Count Alert" 14 | } 15 | 16 | # Function to get query SQL database 17 | function Get-SQLData { 18 | param($Query) 19 | $connectionString = "Server=$dataSource;Database=$database;Integrated Security=SSPI;" 20 | $connection = New-Object -TypeName System.Data.SqlClient.SqlConnection 21 | $connection.ConnectionString = $connectionString 22 | $connection.Open() 23 | 24 | $command = $connection.CreateCommand() 25 | $command.CommandText = $Query 26 | $reader = $command.ExecuteReader() 27 | $table = New-Object -TypeName 'System.Data.DataTable' 28 | $table.Load($reader) 29 | 30 | # Close the connection 31 | $connection.Close() 32 | 33 | return $Table 34 | } 35 | 36 | # Run database query 37 | $Query = " 38 | Select top 1 39 | sum(CMGOnlineClients) as 'CMGOnlineClients',Timestamp 40 | from dbo.BGB_Statistics st 41 | Group by [TimeStamp] 42 | Order by [TimeStamp] desc 43 | " 44 | $Data = Get-SQLData -Query $Query 45 | 46 | # Send alert email if count is low 47 | If ($Data.CMGOnlineClients -le $CMGClientCountThreshold) 48 | { 49 | $Body = @" 50 | 51 | 52 | 53 | The number of clients connecting to the Cloud Management Gateway is low ($($Data.CMGOnlineClients)). There may be an issue with the CMG service. 54 |

55 | Recommended action: Check the CloudMgr.log and the *CMGService.logs on $ServiceConnectionPointName at ..\SMS\Logs for more details.

56 |

57 | Recommended action: Run the Connection Analyzer from the Console at Administration > Cloud Services > Cloud Management Gateway and restart the CMG service if necessary.

58 |

59 | Recommended action: Check the health status of the VM scale set instances in the Azure portal.

60 | 61 | 62 | "@ 63 | 64 | Send-MailMessage @EmailParams -Body $Body -BodyAsHtml -Priority High 65 | } -------------------------------------------------------------------------------- /CMG Monitoring/Check-CMGConnectionPointStatus.ps1: -------------------------------------------------------------------------------- 1 | ############ 2 | ## PARAMS ## 3 | ############ 4 | $script:dataSource = '' # ConfigMgr database server 5 | $script:database = 'CM_XXX'# ConfigMgr database name 6 | $ServiceConnectionPointName = '' 7 | $EmailParams = @{ 8 | To = '' 9 | From = '' 10 | Smtpserver = '.mail.protection.outlook.com' # direct send 11 | Port = 25 12 | Subject = "CMG Connection Point Status alert" 13 | } 14 | 15 | # Function to get query SQL database 16 | function Get-SQLData { 17 | param($Query) 18 | $connectionString = "Server=$dataSource;Database=$database;Integrated Security=SSPI;" 19 | $connection = New-Object -TypeName System.Data.SqlClient.SqlConnection 20 | $connection.ConnectionString = $connectionString 21 | $connection.Open() 22 | 23 | $command = $connection.CreateCommand() 24 | $command.CommandText = $Query 25 | $reader = $command.ExecuteReader() 26 | $table = New-Object -TypeName 'System.Data.DataTable' 27 | $table.Load($reader) 28 | 29 | # Close the connection 30 | $connection.Close() 31 | 32 | return $Table 33 | } 34 | 35 | # Run database query 36 | $Query = " 37 | Select 38 | ServerName, 39 | ProxyServiceName, 40 | ConnectionStatus, 41 | Case 42 | When ConnectionStatus = 0 then 'All connections offline' 43 | When ConnectionStatus = 1 then 'Connections partially online' 44 | When ConnectionStatus = 2 then 'Connections all online' 45 | Else 'Unknown' 46 | End as 'ConnectionStatus Description' 47 | from vProxy_Connectors 48 | where ConnectionStatus != 2 49 | " 50 | 51 | [array]$Data = Get-SQLData -Query $Query 52 | 53 | If ($Data.count -ge 1) 54 | { 55 | foreach ($item in $Data) 56 | { 57 | $Body = @" 58 | 59 | 60 | 61 | The connection point '$($item.ServerName)' for the Cloud Management Gateway '$($item.ProxyServiceName)' is currently in the '$($item.'ConnectionStatus Description')' state. There may be an issue with the CMG service. 62 |

63 | Recommended action: Check the CloudMgr.log and the *CMGService.logs on $ServiceConnectionPointName at ..\SMS\Logs for more details.

64 |

65 | Recommended action: Run the Connection Analyzer from the Console at Administration > Cloud Services > Cloud Management Gateway and restart the CMG service if necessary.

66 |

67 | Recommended action: Check the health status of the VM scale set instances in the Azure portal.

68 | 69 | 70 | "@ 71 | Send-MailMessage @EmailParams -Body $Body -BodyAsHtml -Priority High 72 | 73 | } 74 | } -------------------------------------------------------------------------------- /CMG Monitoring/Check-CMGStatus.ps1: -------------------------------------------------------------------------------- 1 | ############ 2 | ## PARAMS ## 3 | ############ 4 | $script:dataSource = '' # ConfigMgr database server 5 | $script:database = 'CM_XXX'# ConfigMgr database name 6 | $ServiceConnectionPointName = '' 7 | $EmailParams = @{ 8 | To = '' 9 | From = '' 10 | Smtpserver = '.mail.protection.outlook.com' # direct send 11 | Port = 25 12 | Subject = "CMG Status alert" 13 | } 14 | 15 | # Function to get query SQL database 16 | function Get-SQLData { 17 | param($Query) 18 | $connectionString = "Server=$dataSource;Database=$database;Integrated Security=SSPI;" 19 | $connection = New-Object -TypeName System.Data.SqlClient.SqlConnection 20 | $connection.ConnectionString = $connectionString 21 | $connection.Open() 22 | 23 | $command = $connection.CreateCommand() 24 | $command.CommandText = $Query 25 | $reader = $command.ExecuteReader() 26 | $table = New-Object -TypeName 'System.Data.DataTable' 27 | $table.Load($reader) 28 | 29 | # Close the connection 30 | $connection.Close() 31 | 32 | return $Table 33 | } 34 | 35 | # Run database query 36 | $Query = " 37 | select 38 | Name, 39 | Description, 40 | State, 41 | Case 42 | When State = 0 then 'Ready' 43 | When State = 1 then 'Provisioning' 44 | When State = 2 then 'Error' 45 | When State = 3 then 'PerformingMaintenance' 46 | When State = 4 then 'Starting' 47 | When State = 5 then 'Stopping' 48 | When State = 6 then 'Stopped' 49 | Else 'Unknown' 50 | End as 'State Description', 51 | StateDetails 52 | from Azure_Service 53 | where ServiceType = 'CloudProxyService' 54 | and State != 0 55 | " 56 | 57 | [array]$Data = Get-SQLData -Query $Query 58 | 59 | If ($Data.count -ge 1) 60 | { 61 | foreach ($item in $Data) 62 | { 63 | If ($item.State -eq 2) 64 | { 65 | $Body = @" 66 | 67 | 68 | 69 | The Cloud Management Gateway $($item.Name) ($($item.Description)) is in an error state. There may be an issue with the CMG service. 70 |

71 | Recommended action: Check the CloudMgr.log and the *CMGService.logs on $ServiceConnectionPointName at ..\SMS\Logs for more details.

72 |

73 | Recommended action: Run the Connection Analyzer from the Console at Administration > Cloud Services > Cloud Management Gateway and restart the CMG service if necessary.

74 |

75 | Recommended action: Check the health status of the VM scale set instances in the Azure portal.

76 | 77 | 78 | "@ 79 | Send-MailMessage @EmailParams -Body $Body -BodyAsHtml -Priority High 80 | } 81 | Else 82 | { 83 | $Body = @" 84 | 85 | 86 | 87 | The Cloud Management Gateway $($item.Name) ($($item.Description)) is currently in the '$($item.'State Description')' state. 88 | 89 | 90 | "@ 91 | Send-MailMessage @EmailParams -Body $Body -BodyAsHtml 92 | } 93 | } 94 | } -------------------------------------------------------------------------------- /PowerShell Scripts/Compliance Settings/Microsoft Office Templates/Machine Setting/Discovery.ps1: -------------------------------------------------------------------------------- 1 | ###################################################### 2 | ## ## 3 | ## Custom Office Templates Machine Discovery Script ## 4 | ## ## 5 | ###################################################### 6 | 7 | 8 | ## Change History 9 | ## 10 | ## v1.0 (2017-02-28) 11 | 12 | 13 | 14 | ######################## 15 | ## USER-SET VARIABLES ## 16 | ######################## 17 | 18 | # Set the remote template path. This is a common location that is accessible to everyone. 19 | $RemoteTemplatePath = "\\\remotefiles\OfficeTemplates\Providers" 20 | 21 | # This is the root folder in the local template path where all the template providers and files will be created (eg, company name) 22 | $RootFolderName = "" 23 | 24 | 25 | 26 | 27 | ########################## 28 | ## SCRIPT-SET VARIABLES ## 29 | ########################## 30 | 31 | # Determine OS Architecture 32 | $OSArch = Get-WmiObject -Class win32_operatingsystem | select -ExpandProperty OSArchitecture 33 | 34 | # Get the provider names that exist in the remote location 35 | Try 36 | { 37 | [array]$Providers = (Get-ChildItem $RemoteTemplatePath -Directory -ErrorAction Stop).Name 38 | } 39 | Catch 40 | { 41 | # If there is an error accessing the remote location (no network access for example), exit the script with no output 42 | Break 43 | } 44 | 45 | # Set local template path by architecture 46 | If ($OSArch -eq "32-bit") 47 | { 48 | $LocalTemplatePath = "$env:ProgramFiles\Microsoft Office\Templates\$RootFolderName" 49 | } 50 | If ($OSArch -eq "64-bit") 51 | { 52 | $LocalTemplatePath = "${env:ProgramFiles(x86)}\Microsoft Office\Templates\$RootFolderName" 53 | } 54 | 55 | 56 | 57 | 58 | ################# 59 | ## MAIN SCRIPT ## 60 | ################# 61 | 62 | # Check that the local template path exists 63 | If (!(Test-Path "$LocalTemplatePath")) 64 | { 65 | "Not-Compliant on local template path" 66 | Break 67 | } 68 | 69 | # Check local template directory for any provider directories that have been removed in the remote location (cleanup) 70 | [array]$LocalProviders = (Get-ChildItem $LocalTemplatePath -Directory).Name 71 | $LocalProviders | foreach { 72 | If ($Providers -notcontains $_) 73 | { 74 | "Not-Compliant on local provider existing remotely" 75 | Break 76 | } 77 | } 78 | 79 | 80 | # Loop through each provider... 81 | $Providers | Foreach { 82 | 83 | $Provider = $_ 84 | 85 | ############################## 86 | ## PROVIDER DIRECTORY CHECK ## 87 | ############################## 88 | 89 | If (Test-Path -Path "$LocalTemplatePath\$Provider") 90 | { } 91 | Else 92 | { 93 | "Not-Compliant on remote provider existing locally" 94 | Break 95 | } 96 | 97 | 98 | ############################### 99 | ## SUBFOLDER DIRECTORY CHECK ## 100 | ############################### 101 | 102 | # Create an array of the subfolders found for this provider in the remote template directory 103 | Try 104 | { 105 | [array]$RemoteSubfolders = (Get-ChildItem "$RemoteTemplatePath\$Provider" -Exclude "XML" -Directory -ErrorAction Stop).Name 106 | } 107 | Catch 108 | { 109 | # If there is an error accessing the remote location (no network access for example), exit the loop 110 | Break 111 | } 112 | 113 | # Check Local subfolder to see if something is present that is not present in the remote location (cleanup) 114 | [array]$LocalSubfolders = (Get-ChildItem "$LocalTemplatePath\$Provider" -Exclude "XML" -Directory -ErrorAction Stop).Name 115 | If ($LocalSubfolders) 116 | { 117 | $LocalSubfolders | foreach { 118 | 119 | If ($RemoteSubfolders -notcontains $_) 120 | { 121 | "Not-Compliant on local subfolders existing remotely" 122 | Break 123 | } 124 | 125 | } 126 | } 127 | 128 | # For each remote subfolder... 129 | $RemoteSubfolders | foreach { 130 | 131 | $Subfolder = $_ 132 | 133 | # Check that subfolder directory exists 134 | If (Test-Path -Path "$LocalTemplatePath\$Provider\$Subfolder") 135 | { } 136 | Else 137 | { 138 | "Not-Compliant on remote subfolders existing locally" 139 | Break 140 | } 141 | 142 | } 143 | 144 | 145 | ########################## 146 | ## TEMPLATE FILE CHECKS ## 147 | ########################## 148 | 149 | $RemoteSubfolders | foreach { 150 | 151 | $Subfolder = $_ 152 | 153 | # Create an array of template filenames present in the REMOTE path 154 | Try 155 | { 156 | [array]$RemoteFileArray = (Get-ChildItem "$RemoteTemplatePath\$Provider\$Subfolder" -File).Name 157 | } 158 | Catch 159 | { 160 | # If there is an error accessing the remote location (no network access for example), exit the loop 161 | Break 162 | } 163 | 164 | # Create an array of template filenames present in the LOCAL path 165 | [array]$LocalFileArray = (Get-ChildItem "$LocalTemplatePath\$Provider\$Subfolder" -File).Name 166 | 167 | # Check each local file to see if it is present remotely (cleanup) 168 | If ($LocalFileArray) 169 | { 170 | $LocalFileArray | foreach { 171 | 172 | If ($RemoteFileArray -notcontains $_) 173 | { 174 | "Not-Compliant on local file existing remotely" 175 | Break 176 | } 177 | 178 | } 179 | } 180 | 181 | # Loop through each file in the remote template path 182 | $RemoteFileArray | foreach { 183 | 184 | ############################## 185 | ## TEMPLATE EXISTENCE CHECK ## 186 | ############################## 187 | 188 | # Check that the remote template file is present locally 189 | $File = $_ 190 | If ($LocalFileArray) 191 | { 192 | If ($LocalFileArray -contains $File) 193 | { } 194 | Else 195 | { 196 | "Not-Compliant on remote file existing locally" 197 | Break 198 | } 199 | } 200 | 201 | 202 | ############################### 203 | ## TEMPLATE HASH MATCH CHECK ## 204 | ############################### 205 | 206 | # Check Hash 207 | $RemoteFileHash = (Get-FileHash -Path "$RemoteTemplatePath\$Provider\$Subfolder\$File").Hash 208 | $LocalFileHash = (Get-FileHash -Path "$LocalTemplatePath\$Provider\$Subfolder\$File").Hash 209 | If ($LocalFileHash) 210 | { 211 | If ($RemoteFileHash -eq $LocalFileHash) 212 | { } 213 | Else 214 | { 215 | "Not-Compliant on hash match of local and remote file" 216 | Break 217 | } 218 | } 219 | } 220 | } 221 | } 222 | 223 | 224 | ####################### 225 | ## REPORT COMPLIANCE ## 226 | ####################### 227 | 228 | Write-host "Compliant" 229 | -------------------------------------------------------------------------------- /PowerShell Scripts/Compliance Settings/Microsoft Office Templates/Machine Setting/Remediation.ps1: -------------------------------------------------------------------------------- 1 | ######################################################## 2 | ## ## 3 | ## Custom Office Templates Machine Remediation Script ## 4 | ## ## 5 | ######################################################## 6 | 7 | 8 | ## Change History 9 | ## 10 | ## v1.0 (2017-02-28) 11 | 12 | 13 | 14 | ######################## 15 | ## USER-SET VARIABLES ## 16 | ######################## 17 | 18 | # Set the remote template path. This is a common location that is accessible to everyone. 19 | $RemoteTemplatePath = "\\\remotefiles\OfficeTemplates\Providers" 20 | 21 | # This is the root folder in the local template path where all the template providers and files will be created (eg, company name) 22 | $RootFolderName = "" 23 | 24 | 25 | 26 | 27 | ########################## 28 | ## SCRIPT-SET VARIABLES ## 29 | ########################## 30 | 31 | # Determine OS Architecture 32 | $OSArch = Get-WmiObject -Class win32_operatingsystem | select -ExpandProperty OSArchitecture 33 | 34 | # Get the provider names that exist in the remote location 35 | [array]$Providers = (Get-ChildItem $RemoteTemplatePath -Directory -ErrorAction Stop).Name 36 | 37 | # Set local template path by architecture 38 | If ($OSArch -eq "32-bit") 39 | { 40 | $LocalTemplatePath = "$env:ProgramFiles\Microsoft Office\Templates\$RootFolderName" 41 | } 42 | If ($OSArch -eq "64-bit") 43 | { 44 | $LocalTemplatePath = "${env:ProgramFiles(x86)}\Microsoft Office\Templates\$RootFolderName" 45 | } 46 | 47 | 48 | 49 | 50 | ################# 51 | ## MAIN SCRIPT ## 52 | ################# 53 | 54 | # Check that the root local template path exists 55 | If (!(Test-Path -Path "$LocalTemplatePath")) 56 | { 57 | "Creating $LocalTemplatePath" 58 | $TemplatePath = $LocalTemplatePath.Replace("\$RootFolderName","") 59 | New-Item -Path "$TemplatePath" -Name "$RootFolderName" -ItemType container -Force | Out-Null 60 | } 61 | 62 | 63 | ################################ 64 | ## PROVIDER DIRECTORY CLEANUP ## 65 | ################################ 66 | 67 | # Check local template directory for any provider directories that have been removed in the remote location and remove them (cleanup) 68 | [array]$LocalProviders = (Get-ChildItem $LocalTemplatePath -Directory).Name 69 | $LocalProviders | foreach { 70 | 71 | $Provider = $_ 72 | If ($Providers -notcontains $Provider) 73 | { 74 | "Removing Provider $LocalTemplatePath\$Provider recursively" 75 | Remove-Item -Path "$LocalTemplatePath\$Provider" -Recurse -Force 76 | } 77 | 78 | } 79 | 80 | # Loop through each provider... 81 | $Providers | Foreach { 82 | 83 | $Provider = $_ 84 | 85 | ################################# 86 | ## PROVIDER DIRECTORY CREATION ## 87 | ################################# 88 | 89 | If (!(Test-Path -Path "$LocalTemplatePath\$Provider")) 90 | { 91 | "Creating Provider $LocalTemplatePath\$Provider" 92 | New-Item -Path "$LocalTemplatePath" -Name "$Provider" -ItemType container -Force | Out-Null 93 | } 94 | 95 | 96 | ################################# 97 | ## SUBFOLDER DIRECTORY CLEANUP ## 98 | ################################# 99 | 100 | # Create an array of the subfolders found for this provider in the remote template directory 101 | [array]$RemoteSubfolders = (Get-ChildItem "$RemoteTemplatePath\$Provider" -Exclude "XML" -Directory -ErrorAction Stop).Name 102 | 103 | # Check Local subfolder to see if something is present that is not present in the remote location, and remove it (cleanup) 104 | [array]$LocalSubfolders = (Get-ChildItem "$LocalTemplatePath\$Provider" -Exclude "XML" -Directory -ErrorAction Stop).Name 105 | If ($LocalSubfolders) 106 | { 107 | $LocalSubfolders | foreach { 108 | 109 | $Subfolder = $_ 110 | 111 | If ($RemoteSubfolders -notcontains $Subfolder) 112 | { 113 | "Removing subfolder $LocalTemplatePath\$Provider\$Subfolder recursively" 114 | Remove-Item -Path "$LocalTemplatePath\$Provider\$Subfolder" -Recurse -Force 115 | } 116 | 117 | } 118 | } 119 | 120 | 121 | ################################## 122 | ## SUBFOLDER DIRECTORY CREATION ## 123 | ################################## 124 | 125 | # For each remote subfolder... 126 | $RemoteSubfolders | foreach { 127 | 128 | $Subfolder = $_ 129 | 130 | # Create the subfolder directory if required 131 | If (!(Test-Path -Path "$LocalTemplatePath\$Provider\$Subfolder")) 132 | { 133 | "Creating subfolder $LocalTemplatePath\$Provider\$Subfolder" 134 | New-Item -Path "$LocalTemplatePath\$Provider" -Name "$Subfolder" -ItemType container -Force | Out-Null 135 | } 136 | 137 | } 138 | 139 | 140 | 141 | ############################## 142 | ## TEMPLATE FILE ACTIVITIES ## 143 | ############################## 144 | 145 | $RemoteSubfolders | foreach { 146 | 147 | $Subfolder = $_ 148 | 149 | # Create an array of template filenames present in the REMOTE path 150 | [array]$RemoteFileArray = (Get-ChildItem "$RemoteTemplatePath\$Provider\$Subfolder" -File).Name 151 | 152 | # Create an array of template filenames present in the LOCAL path 153 | [array]$LocalFileArray = (Get-ChildItem "$LocalTemplatePath\$Provider\$Subfolder" -File).Name 154 | 155 | 156 | ########################### 157 | ## TEMPLATE FILE CLEANUP ## 158 | ########################### 159 | 160 | # Check each local file to see if it is present remotely (cleanup) 161 | If ($LocalFileArray) 162 | { 163 | $LocalFileArray | foreach { 164 | 165 | $LocalFile = $_ 166 | If ($RemoteFileArray -notcontains $LocalFile) 167 | { 168 | "Removing file $LocalTemplatePath\$Provider\$Subfolder\$LocalFile" 169 | Remove-Item -Path "$LocalTemplatePath\$Provider\$Subfolder\$LocalFile" -Force 170 | } 171 | 172 | } 173 | } 174 | 175 | # Loop through each file in the remote template path 176 | $RemoteFileArray | foreach { 177 | 178 | ############################ 179 | ## TEMPLATE FILE CREATION ## 180 | ############################ 181 | 182 | # Copy the remote template file locally if required 183 | $File = $_ 184 | If ($LocalFileArray -notcontains $File) 185 | { 186 | "Copying file $RemoteTemplatePath\$Provider\$Subfolder\$File to $LocalTemplatePath\$Provider\$Subfolder because it doesn't exist" 187 | Copy-Item -Path "$RemoteTemplatePath\$Provider\$Subfolder\$File" -Destination "$LocalTemplatePath\$Provider\$Subfolder" -Force 188 | } 189 | 190 | ############################################ 191 | ## TEMPLATE UPDATE BASED ON HASH MISMATCH ## 192 | ############################################ 193 | 194 | # Check Hash, copy over if mismatch 195 | $RemoteFileHash = (Get-FileHash -Path "$RemoteTemplatePath\$Provider\$Subfolder\$File").Hash 196 | $LocalFileHash = (Get-FileHash -Path "$LocalTemplatePath\$Provider\$Subfolder\$File").Hash 197 | If ($LocalFileHash) 198 | { 199 | If ($RemoteFileHash -ne $LocalFileHash) 200 | { 201 | "Copying file $RemoteTemplatePath\$Provider\$Subfolder\$File to $LocalTemplatePath\$Provider\$Subfolder because the hash doesn't match" 202 | Copy-Item -Path "$RemoteTemplatePath\$Provider\$Subfolder\$File" -Destination "$LocalTemplatePath\$Provider\$Subfolder" -Force 203 | } 204 | } 205 | 206 | } 207 | 208 | } 209 | 210 | } 211 | -------------------------------------------------------------------------------- /PowerShell Scripts/Compliance Settings/Microsoft Office Templates/User Setting/Discovery.ps1: -------------------------------------------------------------------------------- 1 | ################################################### 2 | ## ## 3 | ## Custom Office Templates User Discovery Script ## 4 | ## ## 5 | ################################################### 6 | 7 | 8 | 9 | ######################## 10 | ## USER-SET VARIABLES ## 11 | ######################## 12 | 13 | # Set the remote template path. This is a common location that is accessible to everyone. 14 | $RemoteTemplatePath = "\\\remotefiles\OfficeTemplates\Providers" 15 | 16 | # This is the root folder in the local template path where all the template providers and files will be created (eg, company name) 17 | $RootFolderName = "" 18 | 19 | # Office versions we will work with. This is used to determine the Office path in the HKCU registry 20 | $OfficeVersionKeys = @( 21 | "16.0", # Office 2016 22 | "15.0", # Office 2013 23 | "14.0" # Office 2010 24 | ) 25 | 26 | 27 | 28 | 29 | ########################## 30 | ## SCRIPT-SET VARIABLES ## 31 | ########################## 32 | 33 | # Determine OS Architecture 34 | $OSArch = Get-WmiObject -Class win32_operatingsystem | select -ExpandProperty OSArchitecture 35 | 36 | # Get the provider names that exist in the remote location 37 | Try 38 | { 39 | [array]$Providers = (Get-ChildItem $RemoteTemplatePath -Directory -ErrorAction Stop).Name 40 | } 41 | Catch 42 | { 43 | # If there is an error accessing the remote location (no network access for example), exit the script with no output 44 | Break 45 | } 46 | 47 | # This is the path to the Templates directory in the user's profile 48 | $UserTemplatePath = "$env:APPDATA\Microsoft\Templates" 49 | 50 | # This is the path to the custom folder we are using to store our XML files in the user's profile 51 | $CustomUserTemplatePath = "$UserTemplatePath\$RootFolderName" 52 | 53 | # Determine which Office version/s we have installed. If the "LanguageResources" branch exists, it should indicate that at least one application in this version of office is installed and being used. 54 | [array]$InstalledOfficeKeys = $null 55 | $OfficeVersionKeys | Foreach { 56 | If (Test-Path "HKCU:\Software\Microsoft\Office\$_\Common\LanguageResources") 57 | { 58 | $InstalledOfficeKeys += $_ 59 | } 60 | } 61 | 62 | # Set the program files directory by architecture 63 | If ($OSArch -eq "32-bit") 64 | { 65 | $Architecture = "x86" 66 | } 67 | If ($OSArch -eq "64-bit") 68 | { 69 | $Architecture = "x64" 70 | } 71 | 72 | 73 | 74 | 75 | ################## 76 | ## SCRIPT START ## 77 | ################## 78 | 79 | 80 | ################################ 81 | ## DIRECTORY EXISTENCE CHECKS ## 82 | ################################ 83 | 84 | # Check that the custom user template path exists 85 | If (!(Test-Path "$CustomUserTemplatePath")) 86 | { 87 | "Not-Compliant on custom user template path" 88 | Break 89 | } 90 | 91 | 92 | 93 | # Check that the XML subfolder exists 94 | If (!(Test-Path "$CustomUserTemplatePath\XML")) 95 | { 96 | "Not-Compliant on custom user template path XML directory" 97 | Break 98 | } 99 | 100 | 101 | # Check that all providers exist locally under the XML directory 102 | Try 103 | { 104 | [array]$LocalProviders = (Get-ChildItem "$CustomUserTemplatePath\XML" -Directory -ErrorAction Stop).Name 105 | } 106 | Catch 107 | { 108 | "Not-Compliant on custom user template provider directories (none found or error)" 109 | Break 110 | } 111 | 112 | $Providers | foreach { 113 | 114 | $Provider = $_ 115 | If ($LocalProviders -notcontains $Provider) 116 | { 117 | "Not-Compliant on existence of remote provider locally" 118 | Break 119 | } 120 | 121 | } 122 | 123 | # Check that no providers exist locally that do not exist remotely (cleanup) 124 | $LocalProviders | foreach { 125 | 126 | $Provider = $_ 127 | If ($Providers -notcontains $Provider) 128 | { 129 | "Not-Compliant on existence of local provider remotely" 130 | Break 131 | } 132 | 133 | } 134 | 135 | 136 | 137 | ######################################## 138 | ## XML FILE EXISTENCE AND HASH CHECKS ## 139 | ######################################## 140 | 141 | # Check that XML files exist for each provider 142 | $Providers | foreach { 143 | 144 | $Provider = $_ 145 | [array]$RemoteXMLFiles = (Get-ChildItem "$RemoteTemplatePath\$Provider\XML" -File -ErrorAction Stop).Name | where {$_ -match $Architecture} # create an array even though only 1 file should be returned as array is used for the cleanup 146 | [array]$LocalXMLFiles = (Get-ChildItem "$CustomUserTemplatePath\XML\$Provider" -File -ErrorAction Stop).Name 147 | 148 | # Check that the XML files that exist remotely also exist locally 149 | $RemoteXMLFiles | foreach { 150 | If ($LocalXMLFiles -notcontains $_) 151 | { 152 | "Not-Compliant on existence of remote XML file locally" 153 | Break 154 | } 155 | } 156 | 157 | # Check that the XML files that exist locally also exist remotely (cleanup) 158 | $LocalXMLFiles | foreach { 159 | If ($RemoteXMLFiles -notcontains $_) 160 | { 161 | "Not-Compliant on existence of local XML file remotely" 162 | Break 163 | } 164 | } 165 | 166 | # Check that the hash values match 167 | $RemoteXMLFiles | foreach { 168 | $File = $_ 169 | $RemoteHash = (Get-FileHash -Path "$RemoteTemplatePath\$Provider\XML\$File").Hash 170 | $LocalHash = (Get-FileHash -Path "$CustomUserTemplatePath\XML\$Provider\$File").Hash 171 | 172 | If ($RemoteHash -ne $LocalHash) 173 | { 174 | "Not-Compliant on XML file hash match" 175 | Break 176 | } 177 | } 178 | 179 | } 180 | 181 | 182 | 183 | ######################### 184 | ## REGISTRY KEY CHECKS ## 185 | ######################### 186 | 187 | # Break if no installed office version detected in registry 188 | If (!$InstalledOfficeKeys) 189 | { 190 | "Not-Compliant on existence of installed office versions in registry" 191 | Break 192 | } 193 | 194 | # Loop throught each installed Office version 195 | $InstalledOfficeKeys | foreach { 196 | 197 | $OfficeVersionCode = $_ 198 | 199 | # Get the list of providers existing in the local registry 200 | Try 201 | { 202 | [array]$LocalRegistryProviders = (Get-ChildItem "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers" -ErrorAction Stop).PSChildName 203 | } 204 | Catch 205 | { 206 | "Not-Compliant on existence of local registry providers (none found or error)" 207 | Break 208 | } 209 | 210 | # Check that each remote provider exists in the current user registry providers 211 | $Providers | foreach { 212 | 213 | If ($LocalRegistryProviders -notcontains $_) 214 | { 215 | "Not-Compliant on existence of remote registry provider locally" 216 | Break 217 | } 218 | 219 | } 220 | 221 | # Check that each local registry provider exists in the remote provider list (cleanup) 222 | $LocalRegistryProviders | foreach { 223 | 224 | If ($Providers -notcontains $_) 225 | { 226 | "Not-Compliant on existence of local registry provider remotely" 227 | Break 228 | } 229 | 230 | } 231 | 232 | # Loop through each provider 233 | $Providers | foreach { 234 | 235 | $Provider = $_ 236 | 237 | # Get the correct XML file for this provider (filter by architecture) 238 | $RemoteXMLFile = (Get-ChildItem "$RemoteTemplatePath\$Provider\XML" -File -ErrorAction Stop).Name | where {$_ -match $Architecture} 239 | 240 | # Define what the ServiceURL value should be and find what it currently is 241 | $CorrectServiceUrl = "$CustomUserTemplatePath\XML\$Provider\$RemoteXMLFile" 242 | $ActualServiceURL = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers\$Provider" -Name ServiceURL -ErrorAction SilentlyContinue | Select -ExpandProperty ServiceURL 243 | 244 | # Check that the ServiceURL key exists 245 | If (!$ActualServiceURL) 246 | { 247 | "Not Compliant on existence of ServiceURL key" 248 | break 249 | } 250 | 251 | # Check that the ServiceURL is correct 252 | If ($ActualServiceURL -ne $CorrectServiceUrl) 253 | { 254 | "Not Compliant on ServiceURL key entry" 255 | break 256 | } 257 | 258 | } 259 | 260 | } 261 | 262 | 263 | 264 | ####################### 265 | ## REPORT COMPLIANCE ## 266 | ####################### 267 | 268 | "Compliant" 269 | -------------------------------------------------------------------------------- /CCMSetup Error Monitoring/Post-CCMSetupReturnCodeAndLogEntries.ps1: -------------------------------------------------------------------------------- 1 | ################################################################### 2 | ## Intune PR script to get ccmsetup installation return codes ## 3 | ## and send the error codes and recent warning/error log entries ## 4 | ## to a Log Analytics workspace ## 5 | ################################################################### 6 | 7 | ## VARIABLES ## 8 | $WorkspaceID = "" # WorkspaceID of the Log Analytics workspace 9 | $PrimaryKey = "" # Primary Key of the Log Analytics workspace 10 | $ProgressPreference = 'SilentlyContinue' 11 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 12 | 13 | 14 | #region Functions 15 | # Create the function to create the authorization signature 16 | # ref https://docs.microsoft.com/en-us/azure/azure-monitor/logs/data-collector-api 17 | Function Build-Signature ($customerId, $sharedKey, $date, $contentLength, $method, $contentType, $resource) 18 | { 19 | $xHeaders = "x-ms-date:" + $date 20 | $stringToHash = $method + "`n" + $contentLength + "`n" + $contentType + "`n" + $xHeaders + "`n" + $resource 21 | 22 | $bytesToHash = [Text.Encoding]::UTF8.GetBytes($stringToHash) 23 | $keyBytes = [Convert]::FromBase64String($sharedKey) 24 | 25 | $sha256 = New-Object System.Security.Cryptography.HMACSHA256 26 | $sha256.Key = $keyBytes 27 | $calculatedHash = $sha256.ComputeHash($bytesToHash) 28 | $encodedHash = [Convert]::ToBase64String($calculatedHash) 29 | $authorization = 'SharedKey {0}:{1}' -f $customerId,$encodedHash 30 | return $authorization 31 | } 32 | 33 | # Create the function to create and post the request 34 | # ref https://docs.microsoft.com/en-us/azure/azure-monitor/logs/data-collector-api 35 | Function Post-LogAnalyticsData($customerId, $sharedKey, $body, $logType) 36 | { 37 | $method = "POST" 38 | $contentType = "application/json" 39 | $resource = "/api/logs" 40 | $rfc1123date = [DateTime]::UtcNow.ToString("r") 41 | $contentLength = $body.Length 42 | $TimeStampField = "" 43 | $signature = Build-Signature ` 44 | -customerId $customerId ` 45 | -sharedKey $sharedKey ` 46 | -date $rfc1123date ` 47 | -contentLength $contentLength ` 48 | -method $method ` 49 | -contentType $contentType ` 50 | -resource $resource 51 | $uri = "https://" + $customerId + ".ods.opinsights.azure.com" + $resource + "?api-version=2016-04-01" 52 | 53 | $headers = @{ 54 | "Authorization" = $signature; 55 | "Log-Type" = $logType; 56 | "x-ms-date" = $rfc1123date; 57 | "time-generated-field" = $TimeStampField; 58 | } 59 | 60 | try { 61 | $response = Invoke-WebRequest -Uri $uri -Method $method -ContentType $contentType -Headers $headers -Body $body -UseBasicParsing 62 | } 63 | catch { 64 | $response = $_#.Exception.Response 65 | } 66 | 67 | return $response 68 | } 69 | 70 | # Function to get the Azure AD device Id 71 | Function Get-AADDeviceID { 72 | $AADCert = (Get-ChildItem Cert:\Localmachine\MY | Where {$_.Issuer -match "CN=MS-Organization-Access"}) 73 | If ($null -ne $AADCert) 74 | { 75 | return $AADCert.Subject.Replace('CN=','') 76 | } 77 | # try some other ways to get the AaddeviceId in case ther cert is missing somehow 78 | else 79 | { 80 | $AadDeviceId = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\CCM" -Name AadDeviceId -ErrorAction SilentlyContinue | Select -ExpandProperty AadDeviceId 81 | If ($null -eq $AadDeviceId) 82 | { 83 | try 84 | { 85 | $dsreg = dsregcmd /status 86 | $DeviceIdMatch = $dsreg | Select-String -SimpleMatch "DeviceId" 87 | If ($DeviceIdMatch -eq 1) 88 | { 89 | return $DeviceIdMatch.Line.Split()[-1] 90 | } 91 | } 92 | catch {} 93 | } 94 | Else 95 | { 96 | return $AadDeviceId 97 | } 98 | } 99 | } 100 | 101 | # Function to return CCM log entries to PS objects 102 | function Convert-CCMLogToObjectArray { 103 | Param ($LogPath,$LineCount = 500) 104 | 105 | # Custom class to define a log entry 106 | class LogEntry { 107 | [string]$LogText 108 | [datetime]$DateTime 109 | [string]$component 110 | [string]$context 111 | [int]$type 112 | [int]$thread 113 | [string]$file 114 | } 115 | 116 | # Function to extract the content between two strings in a string 117 | function Extract-String { 118 | param($String,$SearchStringStart,$SearchStringEnd) 119 | $Length = $SearchStringStart.Length 120 | $StartIndex = $LogLine.IndexOf($SearchStringStart,0) + $Length 121 | $EndIndex = $LogLine.IndexOf($SearchStringEnd,$StartIndex) 122 | return $LogLine.Substring($StartIndex,($EndIndex - $StartIndex)) 123 | } 124 | 125 | If (Test-Path $LogPath) 126 | { 127 | $LogContent = (Get-Content $LogPath -Raw) -split "\remotefiles\OfficeTemplates\Providers" 15 | 16 | # This is the root folder in the local template path where all the template providers and files will be created (eg, company name) 17 | $RootFolderName = "" 18 | 19 | # Office versions we will work with. This is used to determine the Office path in the HKCU registry 20 | $OfficeVersionKeys = @( 21 | "16.0", # Office 2016 22 | "15.0", # Office 2013 23 | "14.0" # Office 2010 24 | ) 25 | 26 | 27 | 28 | 29 | ########################## 30 | ## SCRIPT-SET VARIABLES ## 31 | ########################## 32 | 33 | # Determine OS Architecture 34 | $OSArch = Get-WmiObject -Class win32_operatingsystem | select -ExpandProperty OSArchitecture 35 | 36 | # Get the provider names that exist in the remote location 37 | [array]$Providers = (Get-ChildItem $RemoteTemplatePath -Directory -ErrorAction Stop).Name 38 | 39 | # This is the path to the Templates directory in the user's profile 40 | $UserTemplatePath = "$env:APPDATA\Microsoft\Templates" 41 | 42 | # This is the path to the custom folder we are using to store our XML files in the user's profile 43 | $CustomUserTemplatePath = "$UserTemplatePath\$RootFolderName" 44 | 45 | # Determine which Office version/s we have installed 46 | [array]$InstalledOfficeKeys = $null 47 | $OfficeVersionKeys | Foreach { 48 | If (Test-Path "HKCU:\Software\Microsoft\Office\$_\Common\LanguageResources") 49 | { 50 | $InstalledOfficeKeys += $_ 51 | } 52 | } 53 | 54 | # Set the program files directory by architecture 55 | If ($OSArch -eq "32-bit") 56 | { 57 | $Architecture = "x86" 58 | } 59 | If ($OSArch -eq "64-bit") 60 | { 61 | $Architecture = "x64" 62 | } 63 | 64 | 65 | 66 | 67 | ################## 68 | ## SCRIPT START ## 69 | ################## 70 | 71 | 72 | ################################## 73 | ## DIRECTORY CREATION / CLEANUP ## 74 | ################################## 75 | 76 | # Check that the custom user template path exists 77 | If (!(Test-Path "$CustomUserTemplatePath")) 78 | { 79 | New-Item -Path $UserTemplatePath -Name $RootFolderName -ItemType container -Force 80 | } 81 | 82 | # Check that the XML subfolder exists 83 | If (!(Test-Path "$CustomUserTemplatePath\XML")) 84 | { 85 | New-Item -Path $CustomUserTemplatePath -Name "XML" -ItemType container -Force 86 | } 87 | 88 | # Check that all providers exist locally under the XML directory 89 | [array]$LocalProviders = (Get-ChildItem "$CustomUserTemplatePath\XML" -Directory -ErrorAction Stop).Name 90 | $Providers | foreach { 91 | 92 | $Provider = $_ 93 | If ($LocalProviders -notcontains $Provider) 94 | { 95 | New-Item -Path "$CustomUserTemplatePath\XML" -Name $Provider -ItemType container -Force 96 | } 97 | 98 | } 99 | 100 | # Check that no providers exist locally that do not exist remotely (cleanup) 101 | If ($LocalProviders.Count -ne 0) 102 | { 103 | $LocalProviders | foreach { 104 | 105 | $Provider = $_ 106 | If ($Providers -notcontains $Provider) 107 | { 108 | Remove-Item -Path "$CustomUserTemplatePath\XML\$Provider" -Recurse -Force -Confirm:$false 109 | } 110 | 111 | } 112 | } 113 | 114 | 115 | 116 | ################################# 117 | ## XML FILE CREATION / CLEANUP ## 118 | ################################# 119 | 120 | # Check that XML files exist for each provider 121 | $Providers | foreach { 122 | 123 | $Provider = $_ 124 | [array]$RemoteXMLFiles = (Get-ChildItem "$RemoteTemplatePath\$Provider\XML" -File -ErrorAction Stop).Name | where {$_ -match $Architecture} # create an array even though only 1 file should be returned as array is used for the cleanup 125 | [array]$LocalXMLFiles = (Get-ChildItem "$CustomUserTemplatePath\XML\$Provider" -File -ErrorAction SilentlyContinue).Name 126 | 127 | # Check that the XML files that exist remotely also exist locally 128 | $RemoteXMLFiles | foreach { 129 | 130 | $RemoteXMLFile = $_ 131 | 132 | If ($LocalXMLFiles -notcontains $RemoteXMLFile) 133 | { 134 | Copy-Item "$RemoteTemplatePath\$Provider\XML\$RemoteXMLFile" "$CustomUserTemplatePath\XML\$Provider" -Force 135 | } 136 | 137 | # Regenerate the content branch as the XML file has been added 138 | $InstalledOfficeKeys | foreach { 139 | 140 | $OfficeVersionCode = $_ 141 | 142 | If (Test-Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content") 143 | { 144 | Remove-Item "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content" -Recurse -Force -Confirm:$false 145 | } 146 | 147 | } 148 | } 149 | 150 | # Check that the XML files that exist locally also exist remotely (cleanup) 151 | If ($LocalXMLFiles.Count -ne 0) 152 | { 153 | $LocalXMLFiles | foreach { 154 | 155 | $LocalXMLFile = $_ 156 | 157 | If ($RemoteXMLFiles -notcontains $LocalXMLFile) 158 | { 159 | Remove-Item -Path "$CustomUserTemplatePath\XML\$Provider\$LocalXMLFile" -Force -Confirm:$false 160 | } 161 | } 162 | } 163 | 164 | # Check that the hash values match 165 | $RemoteXMLFiles | foreach { 166 | $File = $_ 167 | $RemoteHash = (Get-FileHash -Path "$RemoteTemplatePath\$Provider\XML\$File").Hash 168 | $LocalHash = (Get-FileHash -Path "$CustomUserTemplatePath\XML\$Provider\$File").Hash 169 | 170 | If ($RemoteHash -ne $LocalHash) 171 | { 172 | Copy-Item "$RemoteTemplatePath\$Provider\XML\$File" "$CustomUserTemplatePath\XML\$Provider" -Force 173 | 174 | # Regenerate the content branch as the XML file has changed 175 | $InstalledOfficeKeys | foreach { 176 | 177 | $OfficeVersionCode = $_ 178 | 179 | If (Test-Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content") 180 | { 181 | Remove-Item "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content" -Recurse -Force -Confirm:$false 182 | } 183 | 184 | } 185 | } 186 | } 187 | } 188 | 189 | 190 | 191 | 192 | ##################################### 193 | ## REGISTRY KEY CREATION / CLEANUP ## 194 | ##################################### 195 | 196 | 197 | # Loop through each installed Office version 198 | $InstalledOfficeKeys | foreach { 199 | 200 | $OfficeVersionCode = $_ 201 | 202 | # Get the list of providers existing in the local registry 203 | [array]$LocalRegistryProviders = (Get-ChildItem "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers" -ErrorAction SilentlyContinue).PSChildName 204 | 205 | # Loop through the providers 206 | $Providers | foreach { 207 | 208 | $Provider = $_ 209 | 210 | # Check that each remote provider exists in the current user registry providers and create the ServiceURL key where necessary 211 | $RemoteXMLFile = (Get-ChildItem "$RemoteTemplatePath\$Provider\XML" -File -ErrorAction Stop).Name | where {$_ -match $Architecture} 212 | $ServiceURLDefinition = "$CustomUserTemplatePath\XML\$Provider\$RemoteXMLFile" 213 | If ($LocalRegistryProviders -notcontains $Provider) 214 | { 215 | New-Item -Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers" -Name $Provider -Force 216 | New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers\$Provider" -Name ServiceURL -Value $ServiceURLDefinition -Force 217 | 218 | # Regenerate the content branch as a new XML has been added 219 | If (Test-Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content") 220 | { 221 | Remove-Item "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content" -Recurse -Force -Confirm:$false 222 | } 223 | } 224 | 225 | # Check that the ServiceURL key is correct 226 | $ActualServiceURL = Get-ItemProperty -Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers\$Provider" -Name ServiceURL -ErrorAction SilentlyContinue | Select -ExpandProperty ServiceURL 227 | If ($ActualServiceURL -ne $ServiceURLDefinition) 228 | { 229 | New-ItemProperty -Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers\$Provider" -Name ServiceURL -Value $ServiceURLDefinition -Force 230 | 231 | # Regenerate the content branch as the XML file may be new 232 | If (Test-Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content") 233 | { 234 | Remove-Item "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content" -Recurse -Force -Confirm:$false 235 | } 236 | } 237 | } 238 | 239 | # Build the list of providers existing in the local registry again since changes may just have been made 240 | [array]$LocalRegistryProviders = (Get-ChildItem "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers" -ErrorAction SilentlyContinue).PSChildName 241 | 242 | # Loop through the local providers in the registry 243 | $LocalRegistryProviders | foreach { 244 | 245 | $Provider = $_ 246 | 247 | # Check that each local registry provider exists in the remote provider list (cleanup) 248 | If ($Providers -notcontains $Provider) 249 | { 250 | Remove-Item -Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Providers\$Provider" -Recurse -Force -Confirm:$false 251 | 252 | # Regenerate the content branch as a provider has been removed 253 | If (Test-Path "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content") 254 | { 255 | Remove-Item "HKCU:\Software\Microsoft\Office\$OfficeVersionCode\Common\Spotlight\Content" -Recurse -Force -Confirm:$false 256 | } 257 | } 258 | 259 | } 260 | 261 | } 262 | -------------------------------------------------------------------------------- /PowerShell Scripts/Compliance Settings/LocalAdministratorInfo/Remediation.ps1: -------------------------------------------------------------------------------- 1 | 2 | 3 | Function New-RegistryItem { 4 | 5 | # Adds data to the registry in HKLM:\Software\IT_Local 6 | 7 | [cmdletBinding()] 8 | Param( 9 | [Parameter(Mandatory=$true)] 10 | [string]$ValueName, 11 | 12 | [Parameter(Mandatory=$true)] 13 | [string]$Value 14 | ) 15 | 16 | $registryPath = "HKLM:SOFTWARE\IT_Local\LocalAdminInfo" 17 | 18 | ## Creating the registry node 19 | if (!(test-path $registryPath)) 20 | { 21 | 22 | try 23 | { 24 | New-Item -Path $registryPath -force -ErrorAction stop | Out-Null 25 | } 26 | catch 27 | { } 28 | } 29 | 30 | ## Creating the registry string and setting its value 31 | try 32 | { 33 | New-ItemProperty -Path $registryPath -Name $ValueName -PropertyType STRING -Value $Value -Force -ErrorAction Stop | Out-Null 34 | } 35 | catch 36 | { } 37 | } 38 | 39 | Function Get-NestedGroupMembership { 40 | 41 | # Gets nested group membership for a user from a group principal up to 3 levels (ie groups within a group) 42 | 43 | Param( 44 | [Parameter(Mandatory=$true)] 45 | [object]$GroupPrincipal, 46 | 47 | [Parameter(Mandatory=$true)] 48 | [string]$TopConsoleUser, 49 | 50 | [Parameter(Mandatory=$false)] 51 | [ValidateSet(1,2,3)] 52 | [int]$Levels = 3 53 | ) 54 | 55 | # Create an array to contain the results 56 | $NestedGroupMembership = @() 57 | 58 | # Get Local Admin Group members that are groups 59 | $Level1Groups = @() 60 | $GroupPrincipal.Members | Foreach { 61 | If ($_.IsSecurityGroup) 62 | { 63 | $Level1Groups += $_ 64 | } 65 | } 66 | 67 | ## LEVEL 1 ## 68 | If ($Level1Groups) 69 | { 70 | # If the nested group contains the user name 71 | $Level1Groups | foreach { 72 | If ($_.Members.SamAccountName -contains $TopConsoleUser) 73 | { 74 | $NestedGroupMembership += $_.SamAccountName 75 | } 76 | } 77 | 78 | ## LEVEL 2## 79 | # If the nested group contains other nested groups 80 | if ($Levels -ge 2) 81 | { 82 | $Level2Groups = @() 83 | $Level1Groups | foreach { 84 | $Members = $_.Members 85 | $Members | foreach { 86 | If ($_.IsSecurityGroup) 87 | { 88 | $Level2Groups += $_ 89 | } 90 | } 91 | 92 | # If the nested group contains the user name 93 | If ($Level2Groups) 94 | { 95 | $Level2Groups | Foreach { 96 | If ($_.Members.SamAccountName -contains $TopConsoleUser) 97 | { 98 | $NestedGroupMembership += $_.SamAccountName 99 | } 100 | } 101 | } 102 | 103 | ## LEVEL 3 ## 104 | # If the nested group contains other nested groups 105 | if ($Levels -ge 3) 106 | { 107 | $Level3Groups = @() 108 | $Level2Groups | foreach { 109 | $Members = $_.Members 110 | $Members | foreach { 111 | If ($_.IsSecurityGroup) 112 | { 113 | $Level3Groups += $_ 114 | } 115 | } 116 | 117 | # If the nested group contains the user name 118 | If ($Level3Groups) 119 | { 120 | $Level3Groups | Foreach { 121 | If ($_.Members.SamAccountName -contains $TopConsoleUser) 122 | { 123 | $NestedGroupMembership += $_.SamAccountName 124 | } 125 | } 126 | } 127 | } 128 | } 129 | } 130 | } 131 | } 132 | 133 | Return $NestedGroupMembership 134 | } 135 | 136 | # Define the list of properties we want 137 | $Properties = @( 138 | "ComputerName", 139 | "TopConsoleUser", 140 | "TopConsoleUserIsAdmin", 141 | "AdminGroupMembershipType", 142 | "LocalAdminGroupMembership", 143 | "NestedGroupMembership", 144 | "OSInstallDate", 145 | "OSAgeInDays", 146 | "LastUpdated" 147 | ) 148 | 149 | # Create a datatable to hold the data 150 | $Datatable = New-Object System.Data.DataTable 151 | $Datatable.Columns.AddRange($Properties) 152 | 153 | # Find top console user 154 | Try 155 | { 156 | $TopConsoleUser = Get-WmiObject -Namespace ROOT\cimv2\sms -Class SMS_SystemConsoleUsage -Property TopConsoleUser -ErrorAction Stop | Select -ExpandProperty TopConsoleUser 157 | # Or optionally use the primary user via UDA, but this can contain multiple user entries... 158 | #$TopConsoleUser = Get-WmiObject -Namespace ROOT\CCM\Policy\Machine\ActualConfig -Class CCM_UserAffinity -Property ConsoleUser -ErrorAction Stop | Select -ExpandProperty ConsoleUser 159 | } 160 | Catch 161 | { 162 | $TopConsoleUser = "Unknown" 163 | } 164 | 165 | # If domain account, strip the domain 166 | if ($TopConsoleUser -match "\\") 167 | { 168 | $TopConsoleUser = $TopConsoleUser.Split('\')[1] 169 | } 170 | 171 | # Create windows identity object for the user account 172 | If ($TopConsoleUser -ne "Unknown") 173 | { 174 | Try 175 | { 176 | $ID = New-Object Security.Principal.WindowsIdentity -ArgumentList $TopConsoleUser 177 | 178 | # Check if the user has the local admin claim 179 | $IsLocalAdmin = $ID.HasClaim('http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid','S-1-5-32-544') 180 | $ID.Dispose() 181 | } 182 | Catch 183 | { 184 | $IsLocalAdmin = "Unknown" 185 | } 186 | } 187 | Else 188 | { 189 | $IsLocalAdmin = "Unknown" 190 | } 191 | 192 | # Get the full local admin group membership 193 | Try 194 | { 195 | Add-Type -AssemblyName System.DirectoryServices.AccountManagement -ErrorAction Stop 196 | $ContextType = [System.DirectoryServices.AccountManagement.ContextType]::Machine 197 | $PrincipalContext = New-Object -TypeName System.DirectoryServices.AccountManagement.PrincipalContext -ArgumentList $ContextType, $($env:COMPUTERNAME) -ErrorAction Stop 198 | $IdentityType = [System.DirectoryServices.AccountManagement.IdentityType]::Name 199 | $GroupPrincipal = [System.DirectoryServices.AccountManagement.GroupPrincipal]::FindByIdentity($PrincipalContext, $IdentityType, “Administrators”) 200 | $LocalAdminMembers = $GroupPrincipal.Members | select -ExpandProperty SamAccountName | Sort-Object 201 | } 202 | Catch 203 | { 204 | $LocalAdminMembers = "Unknown" 205 | } 206 | 207 | # Check the membership of any nested groups in the local admin group (up to 3 levels) 208 | If ($IsLocalAdmin -eq $True -and $LocalAdminMembers -ne "Unknown") 209 | { 210 | [array]$NestedGroupMembership = Get-NestedGroupMembership -GroupPrincipal $GroupPrincipal -TopConsoleUser $TopConsoleUser -Levels 3 211 | $PrincipalContext.Dispose() 212 | $GroupPrincipal.Dispose() 213 | } 214 | ElseIf ($IsLocalAdmin -eq $False) 215 | { 216 | $NestedGroupMembership = "N/A" 217 | } 218 | Else 219 | { 220 | $NestedGroupMembership = "Unknown" 221 | } 222 | 223 | # Convert local admin membership to string format 224 | If ($LocalAdminMembers -ne "Unknown") 225 | { 226 | $LocalAdminMembers | Foreach { 227 | If ($LocalAdminMembersString) 228 | { 229 | $LocalAdminMembersString = $LocalAdminMembersString + ", $_" 230 | } 231 | Else 232 | { 233 | $LocalAdminMembersString = $_ 234 | } 235 | } 236 | } 237 | Else 238 | { 239 | $LocalAdminMembersString = "Unknown" 240 | } 241 | 242 | # Determine if user is local admin by direct membership, nested group or both 243 | If ($IsLocalAdmin -eq $true) 244 | { 245 | If ($LocalAdminMembers -ne "Unknown") 246 | { 247 | If ($LocalAdminMembers -contains $TopConsoleUser -and $NestedGroupMembership.Count -lt 1) 248 | { 249 | $AdminGroupMembershipType = "Direct" 250 | } 251 | ElseIf ($LocalAdminMembers -notcontains $TopConsoleUser -and $NestedGroupMembership.Count -ge 1) 252 | { 253 | $AdminGroupMembershipType = "Nested Group" 254 | } 255 | ElseIf ($LocalAdminMembers -contains $TopConsoleUser -and $NestedGroupMembership.Count -ge 1) 256 | { 257 | $AdminGroupMembershipType = "Direct and Nested Group" 258 | } 259 | Else 260 | { 261 | $AdminGroupMembershipType = "Unknown" 262 | } 263 | } 264 | Else 265 | { 266 | $AdminGroupMembershipType = "Unknown" 267 | } 268 | } 269 | Else 270 | { 271 | $AdminGroupMembershipType = "N/A" 272 | } 273 | 274 | # Convert nested group membership to string format 275 | If ($NestedGroupMembership -ne "Unknown" -and $NestedGroupMembership -ne "N/A" -and $AdminGroupMembershipType -ne "Direct") 276 | { 277 | $NestedGroupMembership | Foreach { 278 | If ($NestedGroupMembershipString) 279 | { 280 | $NestedGroupMembershipString = $NestedGroupMembershipString + ", $_" 281 | } 282 | Else 283 | { 284 | $NestedGroupMembershipString = $_ 285 | } 286 | } 287 | } 288 | ElseIf ($AdminGroupMembershipType -eq "Direct" -or $NestedGroupMembership -eq "N/A") 289 | { 290 | $NestedGroupMembershipString = "N/A" 291 | } 292 | Else 293 | { 294 | $NestedGroupMembershipString = "Unknown" 295 | } 296 | 297 | 298 | # Get the Operating System Install Date 299 | Try 300 | { 301 | [datetime]$InstallDate = [System.Management.ManagementDateTimeConverter]::ToDateTime($(Get-WmiObject win32_OperatingSystem -Property InstallDate -ErrorAction Stop | Select -ExpandProperty InstallDate)) | 302 | Get-date -Format 'yyyy-MM-dd HH:mm:ss' 303 | } 304 | Catch 305 | { 306 | $InstallDate = "Unknown" 307 | } 308 | 309 | # Populate the datatable 310 | [void]$Datatable.Rows.Add($env:COMPUTERNAME,$TopConsoleUser,$IsLocalAdmin,$AdminGroupMembershipType,$LocalAdminMembersString,$NestedGroupMembershipString,$($InstallDate | Get-Date -Format 'yyyy-MM-dd HH:mm:ss'),$((Get-Date)-($InstallDate)).Days,$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')) 311 | 312 | # Tattoo the registry 313 | If ($Datatable.Rows.Count -eq 1) 314 | { 315 | $Properties | Foreach { 316 | Try 317 | { 318 | New-RegistryItem -ValueName $_ -Value $Datatable.Rows[0].$_ 319 | } 320 | Catch {} 321 | } 322 | } 323 | -------------------------------------------------------------------------------- /Windows 11 Compatibility/Create-MEMCMW11CompatibilityCollections.ps1: -------------------------------------------------------------------------------- 1 | ######################################################################################################### 2 | ## Script to create compatibility collections in MEMCM for Windows 11 based on custom inventoried data ## 3 | ######################################################################################################### 4 | 5 | # Windows 11 Version 6 | $W11Version = "21H2" 7 | 8 | # Limiting collection 9 | $LimitingCollection = "All Systems" 10 | 11 | # Import ConfigMgr Module 12 | Import-Module $env:SMS_ADMIN_UI_PATH.Replace('i386','ConfigurationManager.psd1') 13 | $SiteCode = (Get-PSDrive -PSProvider CMSITE).Name 14 | Set-Location ("$SiteCode" + ":") 15 | 16 | # Collection names and query rules 17 | $Collections = [ordered]@{ 18 | "Windows 11 $W11Version Blocked: BDD" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByBdd = ""1""" 19 | "Windows 11 $W11Version Blocked: Bios" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByBios = ""1""" 20 | "Windows 11 $W11Version Blocked: ComputerHardwareId" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByComputerHardwareId = ""1""" 21 | "Windows 11 $W11Version Blocked: CPU" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByCpu = ""1""" 22 | "Windows 11 $W11Version Blocked: CPUFms" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByCpuFms = ""1""" 23 | "Windows 11 $W11Version Blocked: DeviceBlock" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByDeviceBlock = ""1""" 24 | "Windows 11 $W11Version Blocked: HardDiskController" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByHardDiskController = ""1""" 25 | "Windows 11 $W11Version Blocked: Memory" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByMemory = ""1""" 26 | "Windows 11 $W11Version Blocked: Network" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByNetwork = ""1""" 27 | "Windows 11 $W11Version Blocked: Safeguard Hold Any" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.GatedBlockId != ""None""" 28 | "Windows 11 $W11Version Blocked: Safeguard Hold Id 35004082" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.GatedBlockId = ""35004082""" 29 | "Windows 11 $W11Version Blocked: Safeguard Hold Id 35881056" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.GatedBlockId = ""35881056""" 30 | "Windows 11 $W11Version Blocked: SModeState" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedBySModeState = ""1""" 31 | "Windows 11 $W11Version Blocked: SystemDriveSize" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedBySystemDriveSize = ""1""" 32 | "Windows 11 $W11Version Blocked: SystemDriveTooFull" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedBySystemDriveTooFull = ""1""" 33 | "Windows 11 $W11Version Blocked: TPMversion" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByTpmVersion = ""1""" 34 | "Windows 11 $W11Version Blocked: UefiSecureBoot" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByUefiSecureBoot = ""1""" 35 | "Windows 11 $W11Version Blocked: UpgradeableBios" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.BlockedByUpgradableBios = ""1""" 36 | "Windows 11 $W11Version Capable" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceId = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.RedReason = ""None""" 37 | "Windows 11 $W11Version FailedPrereqs" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceId = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.FailedPrereqs != ""None""" 38 | "Windows 11 $W11Version Has Red Reason" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.RedReason != ""None""" 39 | "Windows 11 $W11Version UEX Rating Orange" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.UexRatingOrange > ""0""" 40 | "Windows 11 $W11Version UEX Rating Red" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.UexRatingRed > ""0""" 41 | "Windows 11 $W11Version UEX Rating Yellow" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwoCM on SMS_G_System_COTwentyOneHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwoCM.UexRatingYellow > ""0""" 42 | "Windows 11 $W11Version UEX: Green" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.UpgEx = ""Green""" 43 | "Windows 11 $W11Version UEX: Orange" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.UpgEx = ""Orange""" 44 | "Windows 11 $W11Version UEX: Red" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.UpgEx = ""Red""" 45 | "Windows 11 $W11Version UEX: Yellow" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_COTwentyOneHTwo on SMS_G_System_COTwentyOneHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_COTwentyOneHTwo.UpgEx = ""Yellow""" 46 | } 47 | 48 | # Create the collections 49 | foreach ($CollectionName in $Collections.Keys) 50 | { 51 | Write-host "Creating collection: '$CollectionName'" 52 | $Query = $Collections["$CollectionName"] 53 | $Collection = New-CMDeviceCollection -LimitingCollectionName $LimitingCollection -Name $CollectionName -RefreshType Periodic -RefreshSchedule (Convert-CMSchedule -ScheduleString "920A8C0000100008") 54 | Add-CMDeviceCollectionQueryMembershipRule -CollectionName $Collection.Name -QueryExpression $Query -RuleName "$($Collection.Name)" 55 | } 56 | 57 | # Include collection names for the 'Not capable' collection 58 | $IncludeCollections = @( 59 | "Windows 11 $W11Version Blocked: TPMversion" 60 | "Windows 11 $W11Version Blocked: BDD" 61 | "Windows 11 $W11Version Blocked: Bios" 62 | "Windows 11 $W11Version Blocked: SystemDriveSize" 63 | "Windows 11 $W11Version Blocked: ComputerHardwareId" 64 | "Windows 11 $W11Version Blocked: CPU" 65 | "Windows 11 $W11Version Blocked: CPUFms" 66 | "Windows 11 $W11Version Blocked: DeviceBlock" 67 | "Windows 11 $W11Version Blocked: HardDiskController" 68 | "Windows 11 $W11Version Blocked: Memory" 69 | "Windows 11 $W11Version Blocked: Network" 70 | "Windows 11 $W11Version Blocked: SModeState" 71 | "Windows 11 $W11Version Blocked: SystemDriveTooFull" 72 | "Windows 11 $W11Version Blocked: UefiSecureBoot" 73 | "Windows 11 $W11Version Blocked: UpgradeableBios" 74 | "Windows 11 $W11Version FailedPrereqs" 75 | "Windows 11 $W11Version Blocked: Safeguard Hold Any" 76 | ) 77 | # Create the 'Not capable' collection 78 | $NotCapable = "Windows 11 $W11Version Not Capable" 79 | Write-host "Creating and adding include collections for 'Windows 11 $W11Version Not Capable'" 80 | $Collection = New-CMDeviceCollection -LimitingCollectionName $LimitingCollection -Name $NotCapable -RefreshType Periodic -RefreshSchedule (Convert-CMSchedule -ScheduleString "920A8C0000100008") 81 | foreach ($IncludeCollection in $IncludeCollections) 82 | { 83 | Add-CMDeviceCollectionIncludeMembershipRule -CollectionName "Windows 11 $W11Version Not Capable" -IncludeCollectionName $IncludeCollection 84 | } -------------------------------------------------------------------------------- /Windows 11 22H2 Compatibility/Create-MEMCMW1122H2CompatibilityCollections.ps1: -------------------------------------------------------------------------------- 1 | ############################################################################################################## 2 | ## Script to create compatibility collections in MEMCM for Windows 11 22H2 based on custom inventoried data ## 3 | ############################################################################################################## 4 | 5 | # Windows 11 Version 6 | $W11Version = "22H2" 7 | 8 | # Limiting collection 9 | $LimitingCollection = "All Systems" 10 | 11 | # Import ConfigMgr Module 12 | Import-Module $env:SMS_ADMIN_UI_PATH.Replace('i386','ConfigurationManager.psd1') 13 | $SiteCode = (Get-PSDrive -PSProvider CMSITE).Name 14 | Set-Location ("$SiteCode" + ":") 15 | 16 | # Collection names and query rules 17 | $Collections = [ordered]@{ 18 | "Windows 11 $W11Version Blocked: BDD" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByBdd = ""1""" 19 | "Windows 11 $W11Version Blocked: Bios" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByBios = ""1""" 20 | "Windows 11 $W11Version Blocked: ComputerHardwareId" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByComputerHardwareId = ""1""" 21 | "Windows 11 $W11Version Blocked: CPU" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByCpu = ""1""" 22 | "Windows 11 $W11Version Blocked: CPUFms" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByCpuFms = ""1""" 23 | "Windows 11 $W11Version Blocked: DeviceBlock" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByDeviceBlock = ""1""" 24 | "Windows 11 $W11Version Blocked: HardDiskController" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByHardDiskController = ""1""" 25 | "Windows 11 $W11Version Blocked: Memory" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByMemory = ""1""" 26 | "Windows 11 $W11Version Blocked: Network" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByNetwork = ""1""" 27 | "Windows 11 $W11Version Blocked: Safeguard Hold Any" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.GatedBlockId != ""None""" 28 | "Windows 11 $W11Version Blocked: Safeguard Hold Id 40667045" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.GatedBlockId like ""%40667045%""" 29 | "Windows 11 $W11Version Blocked: Safeguard Hold Id 41291788" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.GatedBlockId like ""%41291788%""" 30 | "Windows 11 $W11Version Blocked: Safeguard Hold Id 41332279" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.GatedBlockId like ""%41332279%""" 31 | "Windows 11 $W11Version Blocked: Safeguard Hold Id 41584256" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.GatedBlockId like ""%41584256%""" 32 | "Windows 11 $W11Version Blocked: SModeState" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedBySModeState = ""1""" 33 | "Windows 11 $W11Version Blocked: SystemDriveSize" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedBySystemDriveSize = ""1""" 34 | "Windows 11 $W11Version Blocked: SystemDriveTooFull" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedBySystemDriveTooFull = ""1""" 35 | "Windows 11 $W11Version Blocked: TPMversion" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByTpmVersion = ""1""" 36 | "Windows 11 $W11Version Blocked: UefiSecureBoot" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByUefiSecureBoot = ""1""" 37 | "Windows 11 $W11Version Blocked: UpgradeableBios" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.BlockedByUpgradableBios = ""1""" 38 | "Windows 11 $W11Version Capable" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceId = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.RedReason = ""None"" and SMS_G_System_NITwentyTwoHTwo.GatedBlockId = ""None""" 39 | "Windows 11 $W11Version FailedPrereqs" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceId = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.FailedPrereqs != ""None""" 40 | "Windows 11 $W11Version Has Red Reason" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.RedReason != ""None""" 41 | "Windows 11 $W11Version UEX Rating Orange" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.UexRatingOrange > ""0""" 42 | "Windows 11 $W11Version UEX Rating Red" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.UexRatingRed > ""0""" 43 | "Windows 11 $W11Version UEX Rating Yellow" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwoCM on SMS_G_System_NITwentyTwoHTwoCM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwoCM.UexRatingYellow > ""0""" 44 | "Windows 11 $W11Version UEX: Green" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.UpgEx = ""Green""" 45 | "Windows 11 $W11Version UEX: Orange" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.UpgEx = ""Orange""" 46 | "Windows 11 $W11Version UEX: Red" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.UpgEx = ""Red""" 47 | "Windows 11 $W11Version UEX: Yellow" = "select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_NITwentyTwoHTwo on SMS_G_System_NITwentyTwoHTwo.ResourceID = SMS_R_System.ResourceId where SMS_G_System_NITwentyTwoHTwo.UpgEx = ""Yellow""" 48 | } 49 | 50 | # Create the collections 51 | foreach ($CollectionName in $Collections.Keys) 52 | { 53 | Write-host "Creating collection: '$CollectionName'" 54 | $Query = $Collections["$CollectionName"] 55 | $Collection = New-CMDeviceCollection -LimitingCollectionName $LimitingCollection -Name $CollectionName -RefreshType Periodic -RefreshSchedule (Convert-CMSchedule -ScheduleString "920A8C0000100008") 56 | Add-CMDeviceCollectionQueryMembershipRule -CollectionName $Collection.Name -QueryExpression $Query -RuleName "$($Collection.Name)" 57 | } 58 | 59 | # Include collection names for the 'Not capable' collection 60 | $IncludeCollections = @( 61 | "Windows 11 $W11Version Blocked: TPMversion" 62 | "Windows 11 $W11Version Blocked: BDD" 63 | "Windows 11 $W11Version Blocked: Bios" 64 | "Windows 11 $W11Version Blocked: SystemDriveSize" 65 | "Windows 11 $W11Version Blocked: ComputerHardwareId" 66 | "Windows 11 $W11Version Blocked: CPU" 67 | "Windows 11 $W11Version Blocked: CPUFms" 68 | "Windows 11 $W11Version Blocked: DeviceBlock" 69 | "Windows 11 $W11Version Blocked: HardDiskController" 70 | "Windows 11 $W11Version Blocked: Memory" 71 | "Windows 11 $W11Version Blocked: Network" 72 | "Windows 11 $W11Version Blocked: SModeState" 73 | "Windows 11 $W11Version Blocked: SystemDriveTooFull" 74 | "Windows 11 $W11Version Blocked: UefiSecureBoot" 75 | "Windows 11 $W11Version Blocked: UpgradeableBios" 76 | "Windows 11 $W11Version FailedPrereqs" 77 | "Windows 11 $W11Version Blocked: Safeguard Hold Any" 78 | ) 79 | # Create the 'Not capable' collection 80 | $NotCapable = "Windows 11 $W11Version Not Capable" 81 | Write-host "Creating and adding include collections for 'Windows 11 $W11Version Not Capable'" 82 | $Collection = New-CMDeviceCollection -LimitingCollectionName $LimitingCollection -Name $NotCapable -RefreshType Periodic -RefreshSchedule (Convert-CMSchedule -ScheduleString "920A8C0000100008") 83 | foreach ($IncludeCollection in $IncludeCollections) 84 | { 85 | Add-CMDeviceCollectionIncludeMembershipRule -CollectionName "Windows 11 $W11Version Not Capable" -IncludeCollectionName $IncludeCollection 86 | } 87 | -------------------------------------------------------------------------------- /Windows 11 22H2 Compatibility/configuration_additions.mof: -------------------------------------------------------------------------------- 1 | //==================== 2 | // NI22H2 AppCompatFlags 3 | //==================== 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2") 6 | #pragma deleteclass("NITwentyTwoHTwo", NOFAIL) 7 | [DYNPROPS] 8 | Class NITwentyTwoHTwo 9 | { 10 | [key] string KeyName; 11 | String DX12; 12 | String GStatus; 13 | String GatedBlockId[]; 14 | String GatedBlockReason[]; 15 | String Guest; 16 | String MCE; 17 | String RedReason[]; 18 | String UpgEx; 19 | String UpgExU; 20 | String DataExpDate; 21 | String DataExpDateEpoch; 22 | String DataRelDate; 23 | String DataRelDateEpoch; 24 | String OemPref; 25 | String SdbVer; 26 | String Version; 27 | String WIP; 28 | String AppraiserVersion; 29 | String Bat; 30 | String Bios; 31 | String BootSect; 32 | String ComfUp; 33 | String Comm; 34 | String Fam; 35 | String Fing; 36 | String Free; 37 | String Gamer; 38 | String GenTelRunTimestamp; 39 | String Genuine; 40 | String ISVM; 41 | String InboxDataVersion; 42 | String Mic; 43 | String OEM; 44 | String Office; 45 | String Paper; 46 | String Perf; 47 | String Proc; 48 | String SystemDriveTooFull; 49 | String Touch; 50 | String DataVer; 51 | String DataVerRecommended; 52 | String FailedPrereqs[]; 53 | String TimestampEpochString; 54 | Uint64 Timestamp; 55 | }; 56 | 57 | [DYNPROPS] 58 | Instance of NITwentyTwoHTwo 59 | { 60 | KeyName="RegKeyToMOF"; 61 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|DX12"),Dynamic,Provider("RegPropProv")] DX12; 62 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|GStatus"),Dynamic,Provider("RegPropProv")] GStatus; 63 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|GatedBlockId"),Dynamic,Provider("RegPropProv")] GatedBlockId; 64 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|GatedBlockReason"),Dynamic,Provider("RegPropProv")] GatedBlockReason; 65 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Guest"),Dynamic,Provider("RegPropProv")] Guest; 66 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|MCE"),Dynamic,Provider("RegPropProv")] MCE; 67 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|RedReason"),Dynamic,Provider("RegPropProv")] RedReason; 68 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|UpgEx"),Dynamic,Provider("RegPropProv")] UpgEx; 69 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|UpgExU"),Dynamic,Provider("RegPropProv")] UpgExU; 70 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|DataExpDate"),Dynamic,Provider("RegPropProv")] DataExpDate; 71 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|DataExpDateEpoch"),Dynamic,Provider("RegPropProv")] DataExpDateEpoch; 72 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|DataRelDate"),Dynamic,Provider("RegPropProv")] DataRelDate; 73 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|DataRelDateEpoch"),Dynamic,Provider("RegPropProv")] DataRelDateEpoch; 74 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|OemPref"),Dynamic,Provider("RegPropProv")] OemPref; 75 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|SdbVer"),Dynamic,Provider("RegPropProv")] SdbVer; 76 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Version"),Dynamic,Provider("RegPropProv")] Version; 77 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|WIP"),Dynamic,Provider("RegPropProv")] WIP; 78 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|AppraiserVersion"),Dynamic,Provider("RegPropProv")] AppraiserVersion; 79 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Bat"),Dynamic,Provider("RegPropProv")] Bat; 80 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Bios"),Dynamic,Provider("RegPropProv")] Bios; 81 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|BootSect"),Dynamic,Provider("RegPropProv")] BootSect; 82 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|ComfUp"),Dynamic,Provider("RegPropProv")] ComfUp; 83 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Comm"),Dynamic,Provider("RegPropProv")] Comm; 84 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Fam"),Dynamic,Provider("RegPropProv")] Fam; 85 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Fing"),Dynamic,Provider("RegPropProv")] Fing; 86 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Free"),Dynamic,Provider("RegPropProv")] Free; 87 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Gamer"),Dynamic,Provider("RegPropProv")] Gamer; 88 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|GenTelRunTimestamp"),Dynamic,Provider("RegPropProv")] GenTelRunTimestamp; 89 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Genuine"),Dynamic,Provider("RegPropProv")] Genuine; 90 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|ISVM"),Dynamic,Provider("RegPropProv")] ISVM; 91 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|InboxDataVersion"),Dynamic,Provider("RegPropProv")] InboxDataVersion; 92 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Mic"),Dynamic,Provider("RegPropProv")] Mic; 93 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|OEM"),Dynamic,Provider("RegPropProv")] OEM; 94 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Office"),Dynamic,Provider("RegPropProv")] Office; 95 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Paper"),Dynamic,Provider("RegPropProv")] Paper; 96 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Perf"),Dynamic,Provider("RegPropProv")] Perf; 97 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Proc"),Dynamic,Provider("RegPropProv")] Proc; 98 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|SystemDriveTooFull"),Dynamic,Provider("RegPropProv")] SystemDriveTooFull; 99 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Touch"),Dynamic,Provider("RegPropProv")] Touch; 100 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|DataVer"),Dynamic,Provider("RegPropProv")] DataVer; 101 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|DataVerRecommended"),Dynamic,Provider("RegPropProv")] DataVerRecommended; 102 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|FailedPrereqs"),Dynamic,Provider("RegPropProv")] FailedPrereqs; 103 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|TimestampEpochString"),Dynamic,Provider("RegPropProv")] TimestampEpochString; 104 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\NI22H2|Timestamp"),Dynamic,Provider("RegPropProv")] Timestamp; 105 | }; 106 | 107 | //========================== 108 | // END NI22H2 AppCompatFlags 109 | //========================== 110 | 111 | 112 | 113 | //============================== 114 | // START NI22H2CM AppCompatFlags 115 | //============================== 116 | 117 | #pragma namespace ("\\\\.\\root\\cimv2") 118 | #pragma deleteclass("NITwentyTwoHTwoCM", NOFAIL) 119 | [DYNPROPS] 120 | Class NITwentyTwoHTwoCM 121 | { 122 | [key] string KeyName; 123 | String BlockedByBdd; 124 | String BlockedByBios; 125 | String BlockedByCloverTrail; 126 | String BlockedByComputerHardwareId; 127 | String BlockedByCpu; 128 | String BlockedByCpuFms; 129 | String BlockedByDeviceBlock; 130 | String BlockedByHardDiskController; 131 | String BlockedByMemory; 132 | String BlockedByNetwork; 133 | String BlockedBySModeState; 134 | String BlockedBySystemDriveSize; 135 | String BlockedBySystemDriveTooFull; 136 | String BlockedByTpmVersion; 137 | String BlockedByUefiSecureBoot; 138 | String BlockedByUpgradableBios; 139 | String Dx12SupportedDevice; 140 | String RAV; 141 | String Guest; 142 | String MediaCenterInUse; 143 | String UexRatingOrange; 144 | String UexRatingRed; 145 | String UexRatingYellow; 146 | String UexUsageRatingOrange; 147 | String UexUsageRatingYellow; 148 | String Version; 149 | String TimestampEpochString; 150 | Uint64 Timestamp; 151 | }; 152 | 153 | [DYNPROPS] 154 | Instance of NITwentyTwoHTwoCM 155 | { 156 | KeyName="RegKeyToMOF"; 157 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByBdd"),Dynamic,Provider("RegPropProv")] BlockedByBdd; 158 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByBios"),Dynamic,Provider("RegPropProv")] BlockedByBios; 159 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByCloverTrail"),Dynamic,Provider("RegPropProv")] BlockedByCloverTrail; 160 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByComputerHardwareId"),Dynamic,Provider("RegPropProv")] BlockedByComputerHardwareId; 161 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByCpu"),Dynamic,Provider("RegPropProv")] BlockedByCpu; 162 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByCpuFms"),Dynamic,Provider("RegPropProv")] BlockedByCpuFms; 163 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByDeviceBlock"),Dynamic,Provider("RegPropProv")] BlockedByDeviceBlock; 164 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByHardDiskController"),Dynamic,Provider("RegPropProv")] BlockedByHardDiskController; 165 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByMemory"),Dynamic,Provider("RegPropProv")] BlockedByMemory; 166 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByNetwork"),Dynamic,Provider("RegPropProv")] BlockedByNetwork; 167 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedBySModeState"),Dynamic,Provider("RegPropProv")] BlockedBySModeState; 168 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedBySystemDriveSize"),Dynamic,Provider("RegPropProv")] BlockedBySystemDriveSize; 169 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedBySystemDriveTooFull"),Dynamic,Provider("RegPropProv")] BlockedBySystemDriveTooFull; 170 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByTpmVersion"),Dynamic,Provider("RegPropProv")] BlockedByTpmVersion; 171 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByUefiSecureBoot"),Dynamic,Provider("RegPropProv")] BlockedByUefiSecureBoot; 172 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|BlockedByUpgradableBios"),Dynamic,Provider("RegPropProv")] BlockedByUpgradableBios; 173 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|Dx12SupportedDevice"),Dynamic,Provider("RegPropProv")] Dx12SupportedDevice; 174 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|RAV"),Dynamic,Provider("RegPropProv")] RAV; 175 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|Guest"),Dynamic,Provider("RegPropProv")] Guest; 176 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|MediaCenterInUse"),Dynamic,Provider("RegPropProv")] MediaCenterInUse; 177 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|UexRatingOrange"),Dynamic,Provider("RegPropProv")] UexRatingOrange; 178 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|UexRatingRed"),Dynamic,Provider("RegPropProv")] UexRatingRed; 179 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|UexRatingYellow"),Dynamic,Provider("RegPropProv")] UexRatingYellow; 180 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|UexUsageRatingOrange"),Dynamic,Provider("RegPropProv")] UexUsageRatingOrange; 181 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|UexUsageRatingYellow"),Dynamic,Provider("RegPropProv")] UexUsageRatingYellow; 182 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|Version"),Dynamic,Provider("RegPropProv")] Version; 183 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|TimestampEpochString"),Dynamic,Provider("RegPropProv")] TimestampEpochString; 184 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\NI22H2|Timestamp"),Dynamic,Provider("RegPropProv")] Timestamp; 185 | }; 186 | 187 | //============================ 188 | // END NI22H2CM AppCompatFlags 189 | //============================ -------------------------------------------------------------------------------- /Windows 11 Compatibility/configuration_additions.mof: -------------------------------------------------------------------------------- 1 | //==================== 2 | // CO21H2 AppCompatFlags 3 | //==================== 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2") 6 | #pragma deleteclass("COTwentyOneHTwo", NOFAIL) 7 | [DYNPROPS] 8 | Class COTwentyOneHTwo 9 | { 10 | [key] string KeyName; 11 | String DX12; 12 | String GStatus; 13 | String GatedBlockId[]; 14 | String GatedBlockReason[]; 15 | String Guest; 16 | String MCE; 17 | String RedReason[]; 18 | String UpgEx; 19 | String UpgExU; 20 | String DataExpDate; 21 | String DataExpDateEpoch; 22 | String DataRelDate; 23 | String DataRelDateEpoch; 24 | String OemPref; 25 | String SdbVer; 26 | String Version; 27 | String WIP; 28 | String AppraiserVersion; 29 | String Bat; 30 | String Bios; 31 | String BootSect; 32 | String ComfUp; 33 | String Comm; 34 | String Fam; 35 | String Fing; 36 | String Free; 37 | String Gamer; 38 | String GenTelRunTimestamp; 39 | String Genuine; 40 | String ISVM; 41 | String InboxDataVersion; 42 | String Mic; 43 | String OEM; 44 | String Office; 45 | String Paper; 46 | String Perf; 47 | String Proc; 48 | String SystemDriveTooFull; 49 | String Touch; 50 | String DataVer; 51 | String DataVerRecommended; 52 | String FailedPrereqs[]; 53 | String TimestampEpochString; 54 | Uint64 Timestamp; 55 | }; 56 | 57 | [DYNPROPS] 58 | Instance of COTwentyOneHTwo 59 | { 60 | KeyName="RegKeyToMOF"; 61 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|DX12"),Dynamic,Provider("RegPropProv")] DX12; 62 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|GStatus"),Dynamic,Provider("RegPropProv")] GStatus; 63 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|GatedBlockId"),Dynamic,Provider("RegPropProv")] GatedBlockId; 64 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|GatedBlockReason"),Dynamic,Provider("RegPropProv")] GatedBlockReason; 65 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Guest"),Dynamic,Provider("RegPropProv")] Guest; 66 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|MCE"),Dynamic,Provider("RegPropProv")] MCE; 67 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|RedReason"),Dynamic,Provider("RegPropProv")] RedReason; 68 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|UpgEx"),Dynamic,Provider("RegPropProv")] UpgEx; 69 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|UpgExU"),Dynamic,Provider("RegPropProv")] UpgExU; 70 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|DataExpDate"),Dynamic,Provider("RegPropProv")] DataExpDate; 71 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|DataExpDateEpoch"),Dynamic,Provider("RegPropProv")] DataExpDateEpoch; 72 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|DataRelDate"),Dynamic,Provider("RegPropProv")] DataRelDate; 73 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|DataRelDateEpoch"),Dynamic,Provider("RegPropProv")] DataRelDateEpoch; 74 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|OemPref"),Dynamic,Provider("RegPropProv")] OemPref; 75 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|SdbVer"),Dynamic,Provider("RegPropProv")] SdbVer; 76 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Version"),Dynamic,Provider("RegPropProv")] Version; 77 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|WIP"),Dynamic,Provider("RegPropProv")] WIP; 78 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|AppraiserVersion"),Dynamic,Provider("RegPropProv")] AppraiserVersion; 79 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Bat"),Dynamic,Provider("RegPropProv")] Bat; 80 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Bios"),Dynamic,Provider("RegPropProv")] Bios; 81 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|BootSect"),Dynamic,Provider("RegPropProv")] BootSect; 82 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|ComfUp"),Dynamic,Provider("RegPropProv")] ComfUp; 83 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Comm"),Dynamic,Provider("RegPropProv")] Comm; 84 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Fam"),Dynamic,Provider("RegPropProv")] Fam; 85 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Fing"),Dynamic,Provider("RegPropProv")] Fing; 86 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Free"),Dynamic,Provider("RegPropProv")] Free; 87 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Gamer"),Dynamic,Provider("RegPropProv")] Gamer; 88 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|GenTelRunTimestamp"),Dynamic,Provider("RegPropProv")] GenTelRunTimestamp; 89 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Genuine"),Dynamic,Provider("RegPropProv")] Genuine; 90 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|ISVM"),Dynamic,Provider("RegPropProv")] ISVM; 91 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|InboxDataVersion"),Dynamic,Provider("RegPropProv")] InboxDataVersion; 92 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Mic"),Dynamic,Provider("RegPropProv")] Mic; 93 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|OEM"),Dynamic,Provider("RegPropProv")] OEM; 94 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Office"),Dynamic,Provider("RegPropProv")] Office; 95 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Paper"),Dynamic,Provider("RegPropProv")] Paper; 96 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Perf"),Dynamic,Provider("RegPropProv")] Perf; 97 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Proc"),Dynamic,Provider("RegPropProv")] Proc; 98 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|SystemDriveTooFull"),Dynamic,Provider("RegPropProv")] SystemDriveTooFull; 99 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Touch"),Dynamic,Provider("RegPropProv")] Touch; 100 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|DataVer"),Dynamic,Provider("RegPropProv")] DataVer; 101 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|DataVerRecommended"),Dynamic,Provider("RegPropProv")] DataVerRecommended; 102 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|FailedPrereqs"),Dynamic,Provider("RegPropProv")] FailedPrereqs; 103 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|TimestampEpochString"),Dynamic,Provider("RegPropProv")] TimestampEpochString; 104 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\CO21H2|Timestamp"),Dynamic,Provider("RegPropProv")] Timestamp; 105 | }; 106 | 107 | //========================== 108 | // END CO21H2 AppCompatFlags 109 | //========================== 110 | 111 | 112 | //============================== 113 | // START CO21H2CM AppCompatFlags 114 | //============================== 115 | 116 | #pragma namespace ("\\\\.\\root\\cimv2") 117 | #pragma deleteclass("COTwentyOneHTwoCM", NOFAIL) 118 | [DYNPROPS] 119 | Class COTwentyOneHTwoCM 120 | { 121 | [key] string KeyName; 122 | String BlockedByBdd; 123 | String BlockedByBios; 124 | String BlockedByCloverTrail; 125 | String BlockedByComputerHardwareId; 126 | String BlockedByCpu; 127 | String BlockedByCpuFms; 128 | String BlockedByDeviceBlock; 129 | String BlockedByHardDiskController; 130 | String BlockedByMemory; 131 | String BlockedByNetwork; 132 | String BlockedBySModeState; 133 | String BlockedBySystemDriveSize; 134 | String BlockedBySystemDriveTooFull; 135 | String BlockedByTpmVersion; 136 | String BlockedByUefiSecureBoot; 137 | String BlockedByUpgradableBios; 138 | String Dx12SupportedDevice; 139 | String RAV; 140 | String Guest; 141 | String MediaCenterInUse; 142 | String UexRatingOrange; 143 | String UexRatingRed; 144 | String UexRatingYellow; 145 | String UexUsageRatingOrange; 146 | String UexUsageRatingYellow; 147 | String Version; 148 | String TimestampEpochString; 149 | Uint64 Timestamp; 150 | }; 151 | 152 | [DYNPROPS] 153 | Instance of COTwentyOneHTwoCM 154 | { 155 | KeyName="RegKeyToMOF"; 156 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByBdd"),Dynamic,Provider("RegPropProv")] BlockedByBdd; 157 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByBios"),Dynamic,Provider("RegPropProv")] BlockedByBios; 158 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByCloverTrail"),Dynamic,Provider("RegPropProv")] BlockedByCloverTrail; 159 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByComputerHardwareId"),Dynamic,Provider("RegPropProv")] BlockedByComputerHardwareId; 160 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByCpu"),Dynamic,Provider("RegPropProv")] BlockedByCpu; 161 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByCpuFms"),Dynamic,Provider("RegPropProv")] BlockedByCpuFms; 162 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByDeviceBlock"),Dynamic,Provider("RegPropProv")] BlockedByDeviceBlock; 163 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByHardDiskController"),Dynamic,Provider("RegPropProv")] BlockedByHardDiskController; 164 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByMemory"),Dynamic,Provider("RegPropProv")] BlockedByMemory; 165 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByNetwork"),Dynamic,Provider("RegPropProv")] BlockedByNetwork; 166 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedBySModeState"),Dynamic,Provider("RegPropProv")] BlockedBySModeState; 167 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedBySystemDriveSize"),Dynamic,Provider("RegPropProv")] BlockedBySystemDriveSize; 168 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedBySystemDriveTooFull"),Dynamic,Provider("RegPropProv")] BlockedBySystemDriveTooFull; 169 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByTpmVersion"),Dynamic,Provider("RegPropProv")] BlockedByTpmVersion; 170 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByUefiSecureBoot"),Dynamic,Provider("RegPropProv")] BlockedByUefiSecureBoot; 171 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|BlockedByUpgradableBios"),Dynamic,Provider("RegPropProv")] BlockedByUpgradableBios; 172 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|Dx12SupportedDevice"),Dynamic,Provider("RegPropProv")] Dx12SupportedDevice; 173 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|RAV"),Dynamic,Provider("RegPropProv")] RAV; 174 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|Guest"),Dynamic,Provider("RegPropProv")] Guest; 175 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|MediaCenterInUse"),Dynamic,Provider("RegPropProv")] MediaCenterInUse; 176 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|UexRatingOrange"),Dynamic,Provider("RegPropProv")] UexRatingOrange; 177 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|UexRatingRed"),Dynamic,Provider("RegPropProv")] UexRatingRed; 178 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|UexRatingYellow"),Dynamic,Provider("RegPropProv")] UexRatingYellow; 179 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|UexUsageRatingOrange"),Dynamic,Provider("RegPropProv")] UexUsageRatingOrange; 180 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|UexUsageRatingYellow"),Dynamic,Provider("RegPropProv")] UexUsageRatingYellow; 181 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|Version"),Dynamic,Provider("RegPropProv")] Version; 182 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|TimestampEpochString"),Dynamic,Provider("RegPropProv")] TimestampEpochString; 183 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\CompatMarkers\\CO21H2|Timestamp"),Dynamic,Provider("RegPropProv")] Timestamp; 184 | }; 185 | 186 | 187 | //============================ 188 | // END CO21H2CM AppCompatFlags 189 | //============================ 190 | 191 | -------------------------------------------------------------------------------- /PowerShell Scripts/Get-CMSelectedSoftwareContentSizes.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | 3 | .SYNOPSIS 4 | Gets the total content sizes of packages in the ConfigMgr Software Library, with the option to target a specific console folder. 5 | 6 | .DESCRIPTION 7 | This script will get the total size of all the packages of the type you specify in the ConfigMgr Software Library. You can do this for Applications, 8 | Standard Packages, Software Update Packages, Driver Packages, OS Image Packages and Boot Image Packages. 9 | In the case of Applications, Standard Packages and Driver Packages, you can limit your results to a specific console folder, if you organise those 10 | package types using folders. 11 | Using the -verbose switch will also report the sizes of the individual packages in the script window. 12 | 13 | .PARAMETER Applications 14 | Specify this switch to search Application content 15 | 16 | .PARAMETER Packages 17 | Specify this switch to search Standard Package content 18 | 19 | .PARAMETER DriverPackages 20 | Specify this switch to search DriverPackage content 21 | 22 | .PARAMETER SoftwareUpdatePackages 23 | Specify this switch to search SoftwareUpdatePackage content 24 | 25 | .PARAMETER OSImages 26 | Specify this switch to search OSImage content 27 | 28 | .PARAMETER BootImages 29 | Specify this switch to search BootImage content 30 | 31 | .PARAMETER FolderName 32 | For Applications, Packages and DriverPackages, use this optional parameter to specify the name of a console folder containing your packages 33 | 34 | .PARAMETER SiteServer 35 | The Site Server name. If not specified, the parameter default will be used. 36 | 37 | .PARAMETER SiteCode 38 | The Site Code. If not specified, the parameter default will be used. 39 | 40 | 41 | .EXAMPLE 42 | .\Get-CMSelectedSoftwareContentSizes.ps1 -Applications 43 | This will calculate the total content size for all Applications in the Application node in the ConfigMgr console, including each deployment type for each Application. 44 | 45 | .EXAMPLE 46 | .\Get-CMSelectedSoftwareContentSizes.ps1 -Applications -FolderName "Default Apps" 47 | This will calculate the total content size of all Applications in the 'Default Apps' console folder, in the Applications node. 48 | 49 | .EXAMPLE 50 | .\Get-CMSelectedSoftwareContentSizes.ps1 -Packages -FolderName "Driver Applications" -Verbose 51 | This will calculate the total content size of all standard packages in the 'Driver Applications' console folder, in the Packages node, and return verbose 52 | output including the content size for each individual package. 53 | 54 | .EXAMPLE 55 | .\Get-CMSelectedSoftwareContentSizes.ps1 -OSImages -Verbose 56 | This will calculate the total content size of all Operating System Images in the Operating System Images node in the ConfigMgr console, and return verbose 57 | output including the content size of each individual OS image. 58 | 59 | .EXAMPLE 60 | .\Get-CMSelectedSoftwareContentSizes.ps1 -DriverPackages -SiteServer sccmsrv-01 -SiteCode ABC -Verbose 61 | This will calculate the total content size of all Driver Packages in the Driver Packages node in the ConfigMgr console, and return verbose 62 | output including the content size of each individual OS image. The site server and site code are different to the default and have been specified. 63 | 64 | .NOTES 65 | Script name: Get-CMSelectedSoftwareContentSizes.ps1 66 | Author: Trevor Jones 67 | Contact: @trevor_smsagent 68 | DateCreated: 2015-04-17 69 | Link: http://smsagent.wordpress.com 70 | 71 | #> 72 | 73 | [CmdletBinding(SupportsShouldProcess=$True)] 74 | param 75 | ( 76 | [Parameter(ParameterSetName="Applications",Mandatory=$True)] 77 | [switch]$Applications, 78 | [Parameter(ParameterSetName="Packages",Mandatory=$True)] 79 | [switch]$Packages, 80 | [Parameter(ParameterSetName="DriverPackages",Mandatory=$True)] 81 | [switch]$DriverPackages, 82 | [Parameter(ParameterSetName="SoftwareUpdatePackages",Mandatory=$True)] 83 | [switch]$SoftwareUpdatePackages, 84 | [Parameter(ParameterSetName="OSImages",Mandatory=$True)] 85 | [switch]$OSImages, 86 | [Parameter(ParameterSetName="BootImages",Mandatory=$True)] 87 | [switch]$BootImages, 88 | 89 | [Parameter(ParameterSetName="Applications",Mandatory=$False,HelpMessage="The name of the console folder containing the applications")] 90 | [Parameter(ParameterSetName="Packages",Mandatory=$False,HelpMessage="The name of the console folder containing the packages")] 91 | [Parameter(ParameterSetName="DriverPackages",Mandatory=$False,HelpMessage="The name of the console folder containing the driver packages")] 92 | [ValidateNotNullOrEmpty()] 93 | [string]$FolderName="", 94 | 95 | [Parameter( 96 | Mandatory=$False, 97 | HelpMessage="The Site Server name" 98 | )] 99 | [string]$SiteServer="mysccmserver", 100 | 101 | [Parameter( 102 | Mandatory=$False, 103 | HelpMessage="The Site Code" 104 | )] 105 | [string]$SiteCode="ABC" 106 | ) 107 | 108 | $ErrorActionPreference = "Stop" 109 | 110 | 111 | switch ($PSCmdlet.ParameterSetName) { 112 | 113 | ################ 114 | # Applications # 115 | ################ 116 | 117 | "Applications" { 118 | 119 | if ($FolderName -ne "") 120 | { 121 | # Get FolderID 122 | Write-Verbose "Getting FolderID of Console Folder '$FolderName'" 123 | $FolderID = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" ` 124 | -Query "select * from SMS_ObjectContainerNode where Name='$FolderName' and ObjectType=6000" | Select ContainerNodeID 125 | $FolderID = $FolderID.ContainerNodeID 126 | If ($FolderID -eq $null -or $FolderID -eq "") 127 | {write-host "No folderID found. Check the folder name is correct." -ForegroundColor Red; break} 128 | Write-Verbose " $FolderID" 129 | 130 | # Get InstanceKey of Folder Members 131 | Write-Verbose "Getting Members of Folder" 132 | $FolderMembers = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" ` 133 | -Query "select * from SMS_ObjectContainerItem where ContainerNodeID='$FolderID'" | Select * | Select InstanceKey 134 | $FolderMembers = $FolderMembers.InstanceKey 135 | write-Verbose " Found $($FolderMembers.Count) applications" 136 | 137 | # Get Application name of each Folder member 138 | write-Verbose "Getting Applications" 139 | $totalsize = 0 140 | foreach ($foldermember in $foldermembers) 141 | { 142 | $PKG = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_ContentPackage where SecurityKey='$Foldermember'" | Select Name,PackageSize 143 | write-Verbose " $($PKG.Name)`: $(($($PKG.PackageSize) / 1KB).ToString(".00")) MB" 144 | $totalsize = $totalsize + $PKG.PackageSize 145 | } 146 | 147 | write-host "Total size of all content files for every application in the '$FolderName' folder is:" -ForegroundColor Green 148 | if ($totalsize -le 1000) 149 | { 150 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 151 | } 152 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 153 | { 154 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 155 | } 156 | else 157 | { 158 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 159 | } 160 | } 161 | 162 | 163 | if ($FolderName -eq "") 164 | { 165 | # Get Applications 166 | write-Verbose "Getting Applications" 167 | $PKGs = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_ContentPackage" | Sort Name | Select Name,PackageSize | Out-GridView -Title "Select Applications" -OutputMode Multiple 168 | write-Verbose "Selected $($PKGs.Count) Applications" 169 | 170 | # Get content sizes 171 | $totalsize = 0 172 | foreach ($PKG in $PKGs) 173 | { 174 | write-Verbose " $($PKG.Name)`: $(($($PKG.PackageSize) / 1KB).ToString(".00")) MB" 175 | $totalsize = $totalsize + $PKG.PackageSize 176 | } 177 | 178 | write-host "Total size of all content files for all selected applications is:" -ForegroundColor Green 179 | if ($totalsize -le 1000) 180 | { 181 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 182 | } 183 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 184 | { 185 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 186 | } 187 | else 188 | { 189 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 190 | } 191 | } 192 | } 193 | 194 | 195 | 196 | ############ 197 | # Packages # 198 | ############ 199 | 200 | "Packages" { 201 | 202 | if ($FolderName -ne "") 203 | { 204 | # Get FolderID 205 | Write-Verbose "Getting FolderID of Console Folder '$FolderName'" 206 | $FolderID = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" ` 207 | -Query "select * from SMS_ObjectContainerNode where Name='$FolderName' and ObjectType=2" | Select ContainerNodeID 208 | $FolderID = $FolderID.ContainerNodeID 209 | If ($FolderID -eq $null -or $FolderID -eq "") 210 | {write-host "No folderID found. Check the folder name is correct." -ForegroundColor Red; break} 211 | Write-Verbose " $FolderID" 212 | 213 | # Get InstanceKey of Folder Members 214 | Write-Verbose "Getting Members of Folder" 215 | $FolderMembers = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" ` 216 | -Query "select * from SMS_ObjectContainerItem where ContainerNodeID='$FolderID'" | Select * | Select InstanceKey 217 | $FolderMembers = $FolderMembers.InstanceKey 218 | write-Verbose " Found $($FolderMembers.Count) packages" 219 | 220 | # Get Package name of each Folder member 221 | write-Verbose "Getting Packages" 222 | $totalsize = 0 223 | foreach ($foldermember in $foldermembers) 224 | { 225 | $PKG = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_Package where PackageID='$Foldermember'" | Select Name,PackageSize 226 | write-Verbose " $($PKG.Name)`: $(($($PKG.PackageSize) / 1KB).ToString(".00")) MB" 227 | $totalsize = $totalsize + $PKG.PackageSize 228 | } 229 | 230 | write-host "Total Size of all content files for every package in the '$FolderName' folder is:" -ForegroundColor Green 231 | if ($totalsize -le 1000) 232 | { 233 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 234 | } 235 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 236 | { 237 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 238 | } 239 | else 240 | { 241 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 242 | } 243 | } 244 | 245 | 246 | if ($FolderName -eq "") 247 | { 248 | # Get Packages 249 | write-Verbose "Getting Packages" 250 | $PKGs = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_Package" | Sort Name | Select Name,PackageSize | Out-GridView -Title "Select Packages" -OutputMode Multiple 251 | write-Verbose "Selected $($PKGs.Count) Packages" 252 | 253 | # Get content sizes 254 | $totalsize = 0 255 | foreach ($PKG in $PKGs) 256 | { 257 | write-Verbose " $($PKG.Name)`: $(($($PKG.PackageSize) / 1KB).ToString(".00")) MB" 258 | $totalsize = $totalsize + $PKG.PackageSize 259 | } 260 | 261 | write-host "Total Size of all content files for all selected standard packages is:" -ForegroundColor Green 262 | if ($totalsize -le 1000) 263 | { 264 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 265 | } 266 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 267 | { 268 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 269 | } 270 | else 271 | { 272 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 273 | } 274 | } 275 | } 276 | 277 | 278 | 279 | ################### 280 | # Driver Packages # 281 | ################### 282 | 283 | "DriverPackages" { 284 | 285 | # No folder name specified 286 | if ($FolderName -ne "") 287 | { 288 | # Get FolderID 289 | Write-Verbose "Getting FolderID of Console Folder '$FolderName'" 290 | $FolderID = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" ` 291 | -Query "select * from SMS_ObjectContainerNode where Name='$FolderName' and ObjectType=23" | Select ContainerNodeID 292 | $FolderID = $FolderID.ContainerNodeID 293 | If ($FolderID -eq $null -or $FolderID -eq "") 294 | {write-host "No folderID found. Check the folder name is correct." -ForegroundColor Red; break} 295 | Write-Verbose " $FolderID" 296 | 297 | # Get InstanceKey of Folder Members 298 | Write-Verbose "Getting Members of Folder" 299 | $FolderMembers = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" ` 300 | -Query "select * from SMS_ObjectContainerItem where ContainerNodeID='$FolderID'" | Select * | Select InstanceKey 301 | $FolderMembers = $FolderMembers.InstanceKey 302 | write-Verbose " Found $($FolderMembers.Count) driver packs" 303 | 304 | # Get driver package name of each Folder member 305 | write-Verbose "Getting Driver Pack Names" 306 | $totalsize = 0 307 | foreach ($foldermember in $foldermembers) 308 | { 309 | $DriverPack = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_DriverPackage where PackageID='$Foldermember'" | Select Name,PackageSize 310 | write-Verbose " $($DriverPack.Name)`: $(($($DriverPack.PackageSize) / 1KB).ToString(".00")) MB" 311 | $totalsize = $totalsize + $DriverPack.PackageSize 312 | } 313 | 314 | write-host "Total Size of all driver packages in the '$FolderName' folder is:" -ForegroundColor Green 315 | if ($totalsize -le 1000) 316 | { 317 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 318 | } 319 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 320 | { 321 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 322 | } 323 | else 324 | { 325 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 326 | } 327 | } 328 | 329 | 330 | # Folder name specified 331 | if ($FolderName -eq "") 332 | { 333 | # Get driver Package names 334 | write-Verbose "Getting Driver Packages" 335 | 336 | $PKGs = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_DriverPackage" | Sort Name | Select Name,PackageSize | Out-GridView -Title "Select Driver Packages" -OutputMode Multiple 337 | write-Verbose "Selected $($PKGs.Count) Driver Packages" 338 | $totalsize = 0 339 | foreach ($PKG in $PKGs) 340 | { 341 | write-Verbose " $($PKG.Name)`: $(($($PKG.PackageSize) / 1KB).ToString(".00")) MB" 342 | $totalsize = $totalsize + $PKG.PackageSize 343 | } 344 | 345 | write-host "Total Size of all content files for all selected driver packages is:" -ForegroundColor Green 346 | if ($totalsize -le 1000) 347 | { 348 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 349 | } 350 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 351 | { 352 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 353 | } 354 | else 355 | { 356 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 357 | } 358 | } 359 | } 360 | 361 | 362 | 363 | ############################ 364 | # Software Update Packages # 365 | ############################ 366 | 367 | "SoftwareUpdatePackages" { 368 | 369 | # Get Software Update Packages 370 | $SUPkgs = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_SoftwareUpdatesPackage" | Select Name,PackageSize | Out-GridView -Title "Select Software Update Packages" -OutputMode Multiple 371 | write-verbose "Selected $($SUPkgs.Count) Software Update Packages" 372 | $totalsize = 0 373 | foreach ($SUPkg in $SUPkgs) 374 | { 375 | write-verbose " $($SUPkg.Name)`: $(($($SUPkg.PackageSize) / 1KB).ToString(".00")) MB" 376 | $totalsize = $totalsize + $SUPkg.PackageSize 377 | } 378 | 379 | write-host "Total Size of all selected Software Update packages is:" -ForegroundColor Green 380 | if ($totalsize -le 1000) 381 | { 382 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 383 | } 384 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 385 | { 386 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 387 | } 388 | else 389 | { 390 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 391 | } 392 | } 393 | 394 | 395 | 396 | ############# 397 | # OS Images # 398 | ############# 399 | 400 | "OSImages" { 401 | 402 | # Get OS Images 403 | $OSImgs = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_ImagePackage" | Select Name,PackageSize | Out-GridView -Title "Select Operating System Image Packages" -OutputMode Multiple 404 | write-verbose "Selected $($OSImgs.Count) OS Images" 405 | $totalsize = 0 406 | foreach ($OSImg in $OSImgs) 407 | { 408 | write-verbose " $($OSImg.Name)`: $(($($OSImg.PackageSize) / 1KB).ToString(".00")) MB" 409 | $totalsize = $totalsize + $OSImg.PackageSize 410 | } 411 | 412 | write-host "Total Size of all selected OS images is:" -ForegroundColor Green 413 | if ($totalsize -le 1000) 414 | { 415 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 416 | } 417 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 418 | { 419 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 420 | } 421 | else 422 | { 423 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 424 | } 425 | } 426 | 427 | 428 | 429 | ############### 430 | # Boot Images # 431 | ############### 432 | 433 | "BootImages" { 434 | 435 | # Get Boot Images 436 | $BootImgs = Get-WmiObject -Namespace "ROOT\SMS\Site_$SiteCode" -Query "select * from SMS_BootImagePackage" | Select Name,PackageSize | Out-GridView -Title "Select Boot Image Packages" -OutputMode Multiple 437 | write-verbose "Selected $($BootImgs.Count) Boot Images" 438 | $totalsize = 0 439 | foreach ($BootImg in $BootImgs) 440 | { 441 | write-verbose " $($BootImg.Name)`: $(($($BootImg.PackageSize) / 1KB).ToString(".00")) MB" 442 | $totalsize = $totalsize + $BootImg.PackageSize 443 | } 444 | 445 | write-host "Total Size of all selected boot images is:" -ForegroundColor Green 446 | if ($totalsize -le 1000) 447 | { 448 | write-host "$(($totalsize).ToString(".00")) KB" -ForegroundColor Green 449 | } 450 | elseif ($totalsize -gt 1000 -and $totalsize -le 1000000) 451 | { 452 | write-host "$(($totalsize / 1KB).ToString(".00")) MB" -ForegroundColor Green 453 | } 454 | else 455 | { 456 | write-host "$(($totalsize / 1MB).ToString(".00")) GB" -ForegroundColor Green 457 | } 458 | } 459 | } -------------------------------------------------------------------------------- /PowerBI Templates/Configuration.mof.additions: -------------------------------------------------------------------------------- 1 | //==================== 2 | // 21H1 AppCompatFlags 3 | //==================== 4 | 5 | #pragma namespace ("\\\\.\\root\\cimv2") 6 | #pragma deleteclass("TwentyOneHOne", NOFAIL) 7 | [DYNPROPS] 8 | Class TwentyOneHOne 9 | { 10 | [key] string KeyName; 11 | String DX12; 12 | String GStatus; 13 | String GatedBlockId[]; 14 | String GatedBlockReason[]; 15 | String Guest; 16 | String MCE; 17 | String RedReason[]; 18 | String UpgEx; 19 | String UpgExU; 20 | String DataExpDate; 21 | String DataExpDateEpoch; 22 | String DataRelDate; 23 | String DataRelDateEpoch; 24 | String OemPref; 25 | String SdbVer; 26 | String Version; 27 | String WIP; 28 | String AppraiserVersion; 29 | String Bat; 30 | String Bios; 31 | String BootSect; 32 | String ComfUp; 33 | String Comm; 34 | String Fam; 35 | String Fing; 36 | String Free; 37 | String Gamer; 38 | String GenTelRunTimestamp; 39 | String Genuine; 40 | String ISVM; 41 | String InboxDataVersion; 42 | String Mic; 43 | String OEM; 44 | String Office; 45 | String Paper; 46 | String Perf; 47 | String Proc; 48 | String SystemDriveTooFull; 49 | String Touch; 50 | String DataVer; 51 | String DataVerRecommended; 52 | String FailedPrereqs[]; 53 | String TimestampEpochString; 54 | Uint64 Timestamp; 55 | }; 56 | 57 | [DYNPROPS] 58 | Instance of TwentyOneHOne 59 | { 60 | KeyName="RegKeyToMOF"; 61 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|DX12"),Dynamic,Provider("RegPropProv")] DX12; 62 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|GStatus"),Dynamic,Provider("RegPropProv")] GStatus; 63 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|GatedBlockId"),Dynamic,Provider("RegPropProv")] GatedBlockId; 64 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|GatedBlockReason"),Dynamic,Provider("RegPropProv")] GatedBlockReason; 65 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Guest"),Dynamic,Provider("RegPropProv")] Guest; 66 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|MCE"),Dynamic,Provider("RegPropProv")] MCE; 67 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|RedReason"),Dynamic,Provider("RegPropProv")] RedReason; 68 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|UpgEx"),Dynamic,Provider("RegPropProv")] UpgEx; 69 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|UpgExU"),Dynamic,Provider("RegPropProv")] UpgExU; 70 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|DataExpDate"),Dynamic,Provider("RegPropProv")] DataExpDate; 71 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|DataExpDateEpoch"),Dynamic,Provider("RegPropProv")] DataExpDateEpoch; 72 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|DataRelDate"),Dynamic,Provider("RegPropProv")] DataRelDate; 73 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|DataRelDateEpoch"),Dynamic,Provider("RegPropProv")] DataRelDateEpoch; 74 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|OemPref"),Dynamic,Provider("RegPropProv")] OemPref; 75 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|SdbVer"),Dynamic,Provider("RegPropProv")] SdbVer; 76 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Version"),Dynamic,Provider("RegPropProv")] Version; 77 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|WIP"),Dynamic,Provider("RegPropProv")] WIP; 78 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|AppraiserVersion"),Dynamic,Provider("RegPropProv")] AppraiserVersion; 79 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Bat"),Dynamic,Provider("RegPropProv")] Bat; 80 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Bios"),Dynamic,Provider("RegPropProv")] Bios; 81 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|BootSect"),Dynamic,Provider("RegPropProv")] BootSect; 82 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|ComfUp"),Dynamic,Provider("RegPropProv")] ComfUp; 83 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Comm"),Dynamic,Provider("RegPropProv")] Comm; 84 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Fam"),Dynamic,Provider("RegPropProv")] Fam; 85 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Fing"),Dynamic,Provider("RegPropProv")] Fing; 86 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Free"),Dynamic,Provider("RegPropProv")] Free; 87 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Gamer"),Dynamic,Provider("RegPropProv")] Gamer; 88 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|GenTelRunTimestamp"),Dynamic,Provider("RegPropProv")] GenTelRunTimestamp; 89 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Genuine"),Dynamic,Provider("RegPropProv")] Genuine; 90 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|ISVM"),Dynamic,Provider("RegPropProv")] ISVM; 91 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|InboxDataVersion"),Dynamic,Provider("RegPropProv")] InboxDataVersion; 92 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Mic"),Dynamic,Provider("RegPropProv")] Mic; 93 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|OEM"),Dynamic,Provider("RegPropProv")] OEM; 94 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Office"),Dynamic,Provider("RegPropProv")] Office; 95 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Paper"),Dynamic,Provider("RegPropProv")] Paper; 96 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Perf"),Dynamic,Provider("RegPropProv")] Perf; 97 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Proc"),Dynamic,Provider("RegPropProv")] Proc; 98 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|SystemDriveTooFull"),Dynamic,Provider("RegPropProv")] SystemDriveTooFull; 99 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Touch"),Dynamic,Provider("RegPropProv")] Touch; 100 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|DataVer"),Dynamic,Provider("RegPropProv")] DataVer; 101 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|DataVerRecommended"),Dynamic,Provider("RegPropProv")] DataVerRecommended; 102 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|FailedPrereqs"),Dynamic,Provider("RegPropProv")] FailedPrereqs; 103 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|TimestampEpochString"),Dynamic,Provider("RegPropProv")] TimestampEpochString; 104 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\21H1|Timestamp"),Dynamic,Provider("RegPropProv")] Timestamp; 105 | }; 106 | 107 | //======================= 108 | // END 21H1 AppCompatFlags 109 | //======================== 110 | 111 | 112 | //==================== 113 | // 20H1 AppCompatFlags 114 | //==================== 115 | 116 | #pragma namespace ("\\\\.\\root\\cimv2") 117 | #pragma deleteclass("TwentyHOne", NOFAIL) 118 | [DYNPROPS] 119 | Class TwentyHOne 120 | { 121 | [key] string KeyName; 122 | String DX12; 123 | String GStatus; 124 | String GatedBlockId[]; 125 | String GatedBlockReason[]; 126 | String Guest; 127 | String MCE; 128 | String RedReason[]; 129 | String UpgEx; 130 | String UpgExU; 131 | String DataExpDate; 132 | String DataExpDateEpoch; 133 | String DataRelDate; 134 | String DataRelDateEpoch; 135 | String OemPref; 136 | String SdbVer; 137 | String Version; 138 | String WIP; 139 | String AppraiserVersion; 140 | String Bat; 141 | String Bios; 142 | String BootSect; 143 | String ComfUp; 144 | String Comm; 145 | String Fam; 146 | String Fing; 147 | String Free; 148 | String Gamer; 149 | String GenTelRunTimestamp; 150 | String Genuine; 151 | String ISVM; 152 | String InboxDataVersion; 153 | String Mic; 154 | String OEM; 155 | String Office; 156 | String Paper; 157 | String Perf; 158 | String Proc; 159 | String SystemDriveTooFull; 160 | String Touch; 161 | String DataVer; 162 | String DataVerRecommended; 163 | String FailedPrereqs[]; 164 | String TimestampEpochString; 165 | Uint64 Timestamp; 166 | }; 167 | 168 | [DYNPROPS] 169 | Instance of TwentyHOne 170 | { 171 | KeyName="RegKeyToMOF"; 172 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|DX12"),Dynamic,Provider("RegPropProv")] DX12; 173 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|GStatus"),Dynamic,Provider("RegPropProv")] GStatus; 174 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|GatedBlockId"),Dynamic,Provider("RegPropProv")] GatedBlockId; 175 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|GatedBlockReason"),Dynamic,Provider("RegPropProv")] GatedBlockReason; 176 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Guest"),Dynamic,Provider("RegPropProv")] Guest; 177 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|MCE"),Dynamic,Provider("RegPropProv")] MCE; 178 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|RedReason"),Dynamic,Provider("RegPropProv")] RedReason; 179 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|UpgEx"),Dynamic,Provider("RegPropProv")] UpgEx; 180 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|UpgExU"),Dynamic,Provider("RegPropProv")] UpgExU; 181 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|DataExpDate"),Dynamic,Provider("RegPropProv")] DataExpDate; 182 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|DataExpDateEpoch"),Dynamic,Provider("RegPropProv")] DataExpDateEpoch; 183 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|DataRelDate"),Dynamic,Provider("RegPropProv")] DataRelDate; 184 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|DataRelDateEpoch"),Dynamic,Provider("RegPropProv")] DataRelDateEpoch; 185 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|OemPref"),Dynamic,Provider("RegPropProv")] OemPref; 186 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|SdbVer"),Dynamic,Provider("RegPropProv")] SdbVer; 187 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Version"),Dynamic,Provider("RegPropProv")] Version; 188 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|WIP"),Dynamic,Provider("RegPropProv")] WIP; 189 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|AppraiserVersion"),Dynamic,Provider("RegPropProv")] AppraiserVersion; 190 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Bat"),Dynamic,Provider("RegPropProv")] Bat; 191 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Bios"),Dynamic,Provider("RegPropProv")] Bios; 192 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|BootSect"),Dynamic,Provider("RegPropProv")] BootSect; 193 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|ComfUp"),Dynamic,Provider("RegPropProv")] ComfUp; 194 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Comm"),Dynamic,Provider("RegPropProv")] Comm; 195 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Fam"),Dynamic,Provider("RegPropProv")] Fam; 196 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Fing"),Dynamic,Provider("RegPropProv")] Fing; 197 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Free"),Dynamic,Provider("RegPropProv")] Free; 198 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Gamer"),Dynamic,Provider("RegPropProv")] Gamer; 199 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|GenTelRunTimestamp"),Dynamic,Provider("RegPropProv")] GenTelRunTimestamp; 200 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Genuine"),Dynamic,Provider("RegPropProv")] Genuine; 201 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|ISVM"),Dynamic,Provider("RegPropProv")] ISVM; 202 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|InboxDataVersion"),Dynamic,Provider("RegPropProv")] InboxDataVersion; 203 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Mic"),Dynamic,Provider("RegPropProv")] Mic; 204 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|OEM"),Dynamic,Provider("RegPropProv")] OEM; 205 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Office"),Dynamic,Provider("RegPropProv")] Office; 206 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Paper"),Dynamic,Provider("RegPropProv")] Paper; 207 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Perf"),Dynamic,Provider("RegPropProv")] Perf; 208 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Proc"),Dynamic,Provider("RegPropProv")] Proc; 209 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|SystemDriveTooFull"),Dynamic,Provider("RegPropProv")] SystemDriveTooFull; 210 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Touch"),Dynamic,Provider("RegPropProv")] Touch; 211 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|DataVer"),Dynamic,Provider("RegPropProv")] DataVer; 212 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|DataVerRecommended"),Dynamic,Provider("RegPropProv")] DataVerRecommended; 213 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|FailedPrereqs"),Dynamic,Provider("RegPropProv")] FailedPrereqs; 214 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|TimestampEpochString"),Dynamic,Provider("RegPropProv")] TimestampEpochString; 215 | [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\TargetVersionUpgradeExperienceIndicators\\20H1|Timestamp"),Dynamic,Provider("RegPropProv")] Timestamp; 216 | }; 217 | 218 | //======================== 219 | // END 20H1 AppCompatFlags 220 | //======================== -------------------------------------------------------------------------------- /Client Health Summary Report/New-CMClientHealthSummaryReport.ps1: -------------------------------------------------------------------------------- 1 | <# 2 | .Synopsis 3 | Generates an overview of client health in your Configuration Manager environment as an html email 4 | .DESCRIPTION 5 | This script dynamically builds an html report based on key client health related data from the Configuration Manager database. The script is intended to be run regularly as a scheduled task. 6 | .EXAMPLE 7 | To run as a scheduled task, use a command like the following: 8 | Powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "\New-CMClientHealthSummaryReport.ps1" 9 | .NOTES 10 | More information can be found here: http://smsagent.wordpress.com/free-configmgr-reports/client-health-summary-report/ 11 | The Parameters region should be updated for your environment before executing the script 12 | Author: Trevor Jones @trevor_smsagent 13 | v1.0 - 2016/11/02 - Intial release 14 | #> 15 | 16 | 17 | #region Parameters 18 | # Database info 19 | $script:dataSource = 'sqlsrv-01\INST_SCCM' # SQL Server name (and instance where applicable) 20 | $script:database = 'CM_ABC' # ConfigMgr Database name 21 | 22 | # Email params 23 | $EmailParams = @{ 24 | To = 'Joe.Blow@contoso.com' 25 | From = 'POSH_Reporting@contoso.com' 26 | Smtpserver = 'mysmtpserver' 27 | Subject = "ConfigMgr Client Health Summary | $(Get-Date -Format dd-MMM-yyyy)" 28 | } 29 | 30 | # Reporting thresholds (percentages) 31 | <# 32 | >= Good - reports as green in the progress bar 33 | >= Warning - reports as amber in the progress bar 34 | < Warning - reports as red in the progress bar 35 | #> 36 | $script:Thresholds = @{} 37 | $Thresholds.Good = 90 38 | $Thresholds.Warning = 80 39 | $Thresholds.Inventory = @{} # Inventory thresholds are applicable to HW inventory, SW inventory and Heartbeat (DDR) only 40 | $Thresholds.Inventory.Good = 85 41 | $Thresholds.Inventory.Warning = 70 42 | #endregion 43 | 44 | #region Functions 45 | # Function to run a sql query 46 | function Get-SQLData { 47 | param($Query) 48 | $connectionString = "Server=$dataSource;Database=$database;Integrated Security=SSPI;" 49 | $connection = New-Object -TypeName System.Data.SqlClient.SqlConnection 50 | $connection.ConnectionString = $connectionString 51 | $connection.Open() 52 | 53 | $command = $connection.CreateCommand() 54 | $command.CommandText = $Query 55 | $reader = $command.ExecuteReader() 56 | $table = New-Object -TypeName 'System.Data.DataTable' 57 | $table.Load($reader) 58 | 59 | # Close the connection 60 | $connection.Close() 61 | 62 | return $Table 63 | } 64 | 65 | # Function to set the progress bar colour based on the the threshold value 66 | function Set-PercentageColour { 67 | param( 68 | [int]$Value, 69 | [switch]$UseInventoryThresholds 70 | ) 71 | 72 | If ($UseInventoryThresholds) 73 | { 74 | $Good = $Thresholds.Inventory.Good 75 | $Warning = $Thresholds.Inventory.Warning 76 | } 77 | Else 78 | { 79 | $Good = $Thresholds.Good 80 | $Warning = $Thresholds.Warning 81 | } 82 | 83 | If ($Value -ge $Good) 84 | { 85 | $Hex = "#00ff00" # Green 86 | } 87 | 88 | If ($Value -ge $Warning -and $Value -lt $Good) 89 | { 90 | $Hex = "#ff9900" # Amber 91 | } 92 | 93 | If ($Value -lt $Warning) 94 | { 95 | $Hex = "#FF0000" # Red 96 | } 97 | 98 | Return $Hex 99 | } 100 | #endregion 101 | 102 | # Create html header 103 | $html = @" 104 | 105 | 106 | 107 | 108 | 109 | "@ 110 | 111 | # Create has table to store data 112 | $Data = @{} 113 | 114 | #region Get Client Count 115 | $Query = " 116 | Select count(ResourceID) as 'Count' from v_R_System where (Client0 = 1) 117 | " 118 | $Data.ClientCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 119 | 120 | # Get No Client Count 121 | $Query = " 122 | Select count(ResourceID) as 'Count' from v_R_System where (Client0 = 0 or Client0 is null) and Unknown0 is null 123 | " 124 | $Data.NoClientCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 125 | 126 | # Calculate Client Percentage 127 | $Data.ClientCountPercentage = [Math]::Round($Data.ClientCount / ($Data.ClientCount + $Data.NoClientCount) * 100) 128 | $Data.NoClientCountPercentage = 100 - $Data.ClientCountPercentage 129 | $Data.TotalDiscoveredSystems = $Data.ClientCount + $Data.NoClientCount 130 | 131 | # Set html 132 | $html = $html + @" 133 |

Discovered Systems with Client Installed

134 | 135 | 136 | 139 | 141 | 142 |
137 | $($Data.ClientCountPercentage)% 138 | 140 |
143 | 144 | 145 | 148 | 151 | 152 | 153 | 156 | 159 | 160 | 161 | 164 | 167 | 168 |
146 | Discovered Systems with Client 147 | 149 | $($Data.ClientCount) 150 |
154 | Discovered Systems without Client 155 | 157 | $($Data.NoClientCount) 158 |
162 | Total 163 | 165 | $($Data.TotalDiscoveredSystems) 166 |
169 | "@ 170 | #endregion 171 | 172 | #region Get Active Count 173 | $Query = " 174 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where ClientActiveStatus = 1 175 | " 176 | $Data.ActiveCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 177 | 178 | # Get InActive Count 179 | $Query = " 180 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where ClientActiveStatus = 0 181 | " 182 | $Data.InactiveCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 183 | 184 | # Calculate Active Percentage 185 | $Data.ActiveCountPercentage = [Math]::Round($Data.ActiveCount / ($Data.ActiveCount + $Data.InactiveCount) * 100) 186 | $Data.InActiveCountPercentage = 100 - $Data.ActiveCountPercentage 187 | $Data.ActiveInactiveTotal = $Data.ActiveCount + $data.InactiveCount 188 | 189 | # Set html 190 | $html = $html + @" 191 |

Active Clients

192 | 193 | 194 | 197 | 199 | 200 |
195 | $($Data.ActiveCountPercentage)% 196 | 198 |
201 | 202 | 203 | 206 | 209 | 210 | 211 | 214 | 217 | 218 | 219 | 222 | 225 | 226 |
204 | Active Clients 205 | 207 | $($Data.ActiveCount) 208 |
212 | Inactive Clients 213 | 215 | $($Data.InActiveCount) 216 |
220 | Total 221 | 223 | $($Data.ActiveInactiveTotal) 224 |
227 | 228 | "@ 229 | #endregion 230 | 231 | #region Get Active/Pass Count 232 | $Query = " 233 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where ClientStateDescription = 'Active/Pass' 234 | " 235 | $Data.ActivePassCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 236 | 237 | # Get Active/Fail Count 238 | $Query = " 239 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where ClientStateDescription = 'Active/Fail' 240 | " 241 | $Data.ActiveFailCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 242 | 243 | # Get Active/Unknown Count 244 | $Query = " 245 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where ClientStateDescription = 'Active/Unknown' 246 | " 247 | $Data.ActiveUnknownCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 248 | 249 | # Calculate Active/Pass Percentage 250 | $Data.ActivePassCountPercentage = [Math]::Round($Data.ActivePassCount / ($Data.ActivePassCount + $Data.ActiveFailCount + $Data.ActiveUnknownCount) * 100) 251 | $Data.ActiveNotPassCountPercentage = 100 - $Data.ActivePassCountPercentage 252 | 253 | # Set html 254 | $html = $html + @" 255 |

Active Clients Health Evaluation

256 | 257 | 258 | 261 | 263 | 264 |
259 | $($Data.ActivePassCountPercentage)% 260 | 262 |
265 | 266 | 267 | 270 | 273 | 274 | 275 | 278 | 281 | 282 | 283 | 286 | 289 | 290 |
268 | Active/Pass 269 | 271 | $($Data.ActivePassCount) 272 |
276 | Active/Fail 277 | 279 | $($Data.ActiveFailCount) 280 |
284 | Active/Unknown 285 | 287 | $($Data.ActiveUnknownCount) 288 |
291 | 292 | "@ 293 | #endregion 294 | 295 | #region Get Active DDR Count 296 | $Query = " 297 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActiveDDR = 1 and ClientActiveStatus = 1 298 | " 299 | $Data.ActiveDDRCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 300 | 301 | # Get InActive DDR Count 302 | $Query = " 303 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActiveDDR = 0 and ClientActiveStatus = 1 304 | " 305 | $Data.InActiveDDRCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 306 | 307 | # Calculate Active DDR Percentage 308 | $Data.ActiveDDRCountPercentage = [Math]::Round($Data.ActiveDDRCount / ($Data.ActiveDDRCount + $Data.InActiveDDRCount) * 100) 309 | $Data.InActiveDDRCountPercentage = 100 - $Data.ActiveDDRCountPercentage 310 | 311 | # Set html 312 | $html = $html + @" 313 |

Active Clients Heartbeat (DDR)

314 | 315 | 316 | 319 | 321 | 322 |
317 | $($Data.ActiveDDRCountPercentage)% 318 | 320 |
323 | 324 | 325 | 328 | 331 | 332 | 333 | 336 | 339 | 340 |
326 | Active DDR 327 | 329 | $($Data.ActiveDDRCount) 330 |
334 | Inactive DDR 335 | 337 | $($Data.InActiveDDRCount) 338 |
341 | "@ 342 | #endregion 343 | 344 | #region Get Active HW Count 345 | $Query = " 346 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActiveHW = 1 and ClientActiveStatus = 1 347 | " 348 | $Data.ActiveHWCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 349 | 350 | # Get InActive HW Count 351 | $Query = " 352 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActiveHW = 0 and ClientActiveStatus = 1 353 | " 354 | $Data.InActiveHWCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 355 | 356 | # Calculate Active HW Percentage 357 | $Data.ActiveHWCountPercentage = [Math]::Round($Data.ActiveHWCount / ($Data.ActiveHWCount + $Data.InActiveHWCount) * 100) 358 | $Data.InActiveHWCountPercentage = 100 - $Data.ActiveHWCountPercentage 359 | 360 | # Set html 361 | $html = $html + @" 362 |

Active Clients Hardware Inventory

363 | 364 | 365 | 368 | 370 | 371 |
366 | $($Data.ActiveHWCountPercentage)% 367 | 369 |
372 | 373 | 374 | 377 | 380 | 381 | 382 | 385 | 388 | 389 |
375 | Active HW Inventory 376 | 378 | $($Data.ActiveHWCount) 379 |
383 | Inactive HW Inventory 384 | 386 | $($Data.InActiveHWCount) 387 |
390 | "@ 391 | #endregion 392 | 393 | #region Get Active SW Count 394 | $Query = " 395 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActiveSW = 1 and ClientActiveStatus = 1 396 | " 397 | $Data.ActiveSWCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 398 | 399 | # Get InActive SW Count 400 | $Query = " 401 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActiveSW = 0 and ClientActiveStatus = 1 402 | " 403 | $Data.InActiveSWCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 404 | 405 | # Calculate Active SW Percentage 406 | $Data.ActiveSWCountPercentage = [Math]::Round($Data.ActiveSWCount / ($Data.ActiveSWCount + $Data.InActiveSWCount) * 100) 407 | $Data.InActiveSWCountPercentage = 100 - $Data.ActiveSWCountPercentage 408 | 409 | # Set html 410 | $html = $html + @" 411 |

Active Clients Software Inventory

412 | 413 | 414 | 417 | 419 | 420 |
415 | $($Data.ActiveSWCountPercentage)% 416 | 418 |
421 | 422 | 423 | 426 | 429 | 430 | 431 | 434 | 437 | 438 |
424 | Active SW Inventory 425 | 427 | $($Data.ActiveSWCount) 428 |
432 | Inactive SW Inventory 433 | 435 | $($Data.InActiveSWCount) 436 |
439 | "@ 440 | #endregion 441 | 442 | #region Get Active PolicyRequest Count 443 | $Query = " 444 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActivePolicyRequest = 1 and ClientActiveStatus = 1 445 | " 446 | $Data.ActivePRCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 447 | 448 | # Get InActive PolicyRequest Count 449 | $Query = " 450 | Select count(ResourceID) as 'Count' from v_CH_ClientSummary where IsActivePolicyRequest = 0 and ClientActiveStatus = 1 451 | " 452 | $Data.InActivePRCount = Get-SQLData -Query $Query | Select -ExpandProperty Count 453 | 454 | # Calculate Active PolicyRequest Percentage 455 | $Data.ActivePRCountPercentage = [Math]::Round($Data.ActivePRCount / ($Data.ActivePRCount + $Data.InActivePRCount) * 100) 456 | $Data.InActivePRCountPercentage = 100 - $Data.ActivePRCountPercentage 457 | 458 | # Set html 459 | $html = $html + @" 460 |

Active Clients Policy Request

461 | 462 | 463 | 466 | 468 | 469 |
464 | $($Data.ActivePRCountPercentage)% 465 | 467 |
470 | 471 | 472 | 475 | 478 | 479 | 480 | 483 | 486 | 487 |
473 | Active Policy Request 474 | 476 | $($Data.ActivePRCount) 477 |
481 | Inactive Policy Request 482 | 484 | $($Data.InActivePRCount) 485 |
488 | "@ 489 | #endregion 490 | 491 | #region Get Client Versions 492 | $Query = " 493 | Select sys.Client_Version0 as 'Client Version', count (sys.ResourceID) as 'Count' from v_R_System sys 494 | inner join v_CH_ClientSummary ch on sys.ResourceID = ch.ResourceID 495 | where ch.ClientActiveStatus = 1 496 | Group by sys.Client_Version0 497 | Order by sys.Client_Version0 desc 498 | " 499 | $Data.ClientVersions = Get-SQLData -Query $Query 500 | $Data.TotalForClientVersions = [int]0 501 | $data.ClientVersions | foreach { 502 | $Data.TotalForClientVersions = $Data.TotalForClientVersions + $_.Count 503 | } 504 | 505 | # Set html 506 | $html = $html + @" 507 |

508 |

Client Versions

509 | 510 | 511 | 512 | 513 | 514 | 515 |
VersionCountPercent
516 | "@ 517 | 518 | $Data.ClientVersions | foreach { 519 | $Percentage = [Math]::Round($_.Count / $Data.TotalForClientVersions * 100) 520 | $PercentageRemaining = (100 - $Percentage) 521 | $html = $html + @" 522 | 523 | 524 | 527 | 530 | 533 | 534 |
525 | $($_.'Client Version') 526 | 528 | $($_.Count) 529 | 531 | $($Percentage)% 532 |
535 | "@ 536 | } 537 | #endregion 538 | 539 | #region Get No Client Systems 540 | 541 | $Data.NoClient = @{} 542 | # no client - unknown OS 543 | $Query = " 544 | Select count(ResourceID) as 'Count' from v_R_System 545 | where (Client0 = 0 or Client0 is null) 546 | and Unknown0 is null 547 | and Operating_System_Name_and0 like 'unknown%' 548 | " 549 | $Data.NoClient.UnknownOS = Get-SQLData -Query $Query | Select -ExpandProperty Count 550 | 551 | # no client windows OS 552 | $Query = " 553 | Select count(ResourceID) as 'Count' from v_R_System 554 | where (Client0 = 0 or Client0 is null) 555 | and Unknown0 is null 556 | and Operating_System_Name_and0 like '%Windows%' 557 | " 558 | $Data.NoClient.WindowsOS = Get-SQLData -Query $Query | Select -ExpandProperty Count 559 | 560 | # no client other OS 561 | $Query = " 562 | Select count(ResourceID) as 'Count' from v_R_System 563 | where (Client0 = 0 or Client0 is null) 564 | and Unknown0 is null 565 | and Operating_System_Name_and0 not like '%Windows%' 566 | and Operating_System_Name_and0 not like 'unknown%' 567 | " 568 | $Data.NoClient.OtherOS = Get-SQLData -Query $Query | Select -ExpandProperty Count 569 | 570 | # no client and no last logon timestamp in last 7 days 571 | $Query = " 572 | Select count(ResourceID) as 'Count' from v_R_System 573 | where (Client0 = 0 or Client0 is null) 574 | and Unknown0 is null 575 | and (DATEDIFF(day,Last_Logon_Timestamp0, GetDate())) >= 7 576 | " 577 | $Data.NoClient.GTLast7 = Get-SQLData -Query $Query | Select -ExpandProperty Count 578 | 579 | # no client and last logon timestamp within last 7 days 580 | $Query = " 581 | Select count(ResourceID) as 'Count' from v_R_System 582 | where (Client0 = 0 or Client0 is null) 583 | and Unknown0 is null 584 | and (DATEDIFF(day,Last_Logon_Timestamp0, GetDate())) < 7 585 | " 586 | $Data.NoClient.LTLast7 = Get-SQLData -Query $Query | Select -ExpandProperty Count 587 | 588 | # Set html 589 | $html = $html + @" 590 |

591 |

Systems with No Client

592 | 593 | 594 | 595 | 596 | 597 | 598 |
CategoryCountPercent
599 | "@ 600 | 601 | $html = $html + @" 602 | 603 | 604 | 607 | 610 | 613 | 614 | 615 | 618 | 621 | 624 | 625 | 626 | 629 | 632 | 635 | 636 | 637 | 640 | 643 | 646 | 647 | 648 | 651 | 654 | 657 | 658 |
605 | Windows OS 606 | 608 | $($Data.NoClient.WindowsOS) 609 | 611 | $([Math]::Round($Data.NoClient.WindowsOS / $Data.NoClientCount * 100))% 612 |
616 | Other OS 617 | 619 | $($Data.NoClient.OtherOS) 620 | 622 | $([Math]::Round($Data.NoClient.OtherOS / $Data.NoClientCount * 100))% 623 |
627 | Unknown OS 628 | 630 | $($Data.NoClient.UnknownOS) 631 | 633 | $([Math]::Round($Data.NoClient.UnknownOS / $Data.NoClientCount * 100))% 634 |
638 | Last Logon > 7 days 639 | 641 | $($Data.NoClient.GTLast7) 642 | 644 | $([Math]::Round($Data.NoClient.GTLast7 / $Data.NoClientCount * 100))% 645 |
649 | Last Logon < 7 days 650 | 652 | $($Data.NoClient.LTLast7) 653 | 655 | $([Math]::Round($Data.NoClient.LTLast7 / $Data.NoClientCount * 100))% 656 |
659 | "@ 660 | #endregion 661 | 662 | #region Windows Client Installation Failures 663 | $Query = " 664 | select count(cdr.MachineID) as 'Count', 665 | cdr.CP_LastInstallationError as 'Error Code' 666 | from v_CombinedDeviceResources cdr 667 | where 668 | cdr.IsClient = 0 669 | and cdr.DeviceOS like '%Windows%' 670 | group by cdr.CP_LastInstallationError 671 | " 672 | $InstallErrors = Get-SQLData -Query $Query 673 | 674 | # Translate error codes to friendly names and add the percentage value 675 | $TotalErrors = 0 676 | $InstallErrors | foreach { 677 | $TotalErrors = $TotalErrors + $_.Count 678 | } 679 | $Data.InstallFailures = $InstallErrors | Select Count,'Error Code',@{n='Error Description';e={([ComponentModel.Win32Exception]$_.'Error Code').Message}},@{n='Percentage';e={[Math]::Round($_.Count / $TotalErrors * 100)}} | Sort Count -Descending 680 | 681 | # Set html 682 | $html = $html + @" 683 |

684 |

Windows Client Installation Failures

685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 |
Error CodeError DescriptionCountPercent
693 | "@ 694 | 695 | $Data.InstallFailures | foreach { 696 | $html = $html + @" 697 | 698 | 699 | 702 | 705 | 708 | 711 | 712 |
700 | $($_.'Error Code') 701 | 703 | $($_.'Error Description') 704 | 706 | $($_.Count) 707 | 709 | $($_.Percentage)% 710 |
713 | "@ 714 | } 715 | #endregion 716 | 717 | #region Computer reboots 718 | 719 | # Active systems with a known Last BootUp Time 720 | $Query = " 721 | select Count(ch.ResourceID) as 'Count' 722 | from v_CH_ClientSummary ch 723 | left join v_GS_OPERATING_SYSTEM os on os.ResourceId = ch.ResourceId 724 | where os.LastBootUpTime0 is not null 725 | and ch.ClientActiveStatus = 1 726 | " 727 | $Data.ActiveLastBootUpTotal = Get-SQLData -Query $Query | Select -ExpandProperty Count 728 | 729 | # Computer reboot dates 730 | $Query = " 731 | select '7 days' as TimePeriod,Count(sys.Name0) as 'Count',1 SortOrder 732 | from v_R_System sys 733 | inner join v_GS_OPERATING_SYSTEM os on os.ResourceId = sys.ResourceId 734 | inner join v_CH_ClientSummary ch on ch.ResourceID = sys.ResourceID 735 | where os.LastBootUpTime0 < DATEADD(day,-7, GETDATE()) 736 | and ch.ClientActiveStatus = 1 737 | UNION 738 | select '14 days' as TimePeriod,Count(sys.Name0) as 'Count',2 739 | from v_R_System sys 740 | inner join v_GS_OPERATING_SYSTEM os on os.ResourceId = sys.ResourceId 741 | inner join v_CH_ClientSummary ch on ch.ResourceID = sys.ResourceID 742 | where os.LastBootUpTime0 < DATEADD(day,-14, GETDATE()) 743 | and ch.ClientActiveStatus = 1 744 | UNION 745 | select '1 month' as TimePeriod,Count(sys.Name0) as 'Count',3 746 | from v_R_System sys 747 | inner join v_GS_OPERATING_SYSTEM os on os.ResourceId = sys.ResourceId 748 | inner join v_CH_ClientSummary ch on ch.ResourceID = sys.ResourceID 749 | where os.LastBootUpTime0 < DATEADD(month,-1, GETDATE()) 750 | and ch.ClientActiveStatus = 1 751 | UNION 752 | select '3 months' as TimePeriod,Count(sys.Name0) as 'Count',4 753 | from v_R_System sys 754 | inner join v_GS_OPERATING_SYSTEM os on os.ResourceId = sys.ResourceId 755 | inner join v_CH_ClientSummary ch on ch.ResourceID = sys.ResourceID 756 | where os.LastBootUpTime0 < DATEADD(MONTH,-3, GETDATE()) 757 | and ch.ClientActiveStatus = 1 758 | UNION 759 | select '6 months' as TimePeriod,Count(sys.Name0) as 'Count',5 760 | from v_R_System sys 761 | inner join v_GS_OPERATING_SYSTEM os on os.ResourceId = sys.ResourceId 762 | inner join v_CH_ClientSummary ch on ch.ResourceID = sys.ResourceID 763 | where os.LastBootUpTime0 < DATEADD(MONTH,-6, GETDATE()) 764 | and ch.ClientActiveStatus = 1 765 | Order By SortOrder 766 | " 767 | $Data.ComputerReboots = Get-SQLData -Query $Query 768 | 769 | # Set html 770 | $html = $html + @" 771 |

772 |

Computers Not Rebooted

773 | 774 | 775 | 776 | 777 | 778 | 779 |
Time PeriodCountPercent*
780 | "@ 781 | 782 | $html = $html + @" 783 | 784 | 785 | 788 | 791 | 794 | 795 | 796 | 799 | 802 | 805 | 806 | 807 | 810 | 813 | 816 | 817 | 818 | 821 | 824 | 827 | 828 | 829 | 832 | 835 | 838 | 839 |
786 | $($Data.ComputerReboots[0].TimePeriod) 787 | 789 | $($Data.ComputerReboots[0].Count) 790 | 792 | $([Math]::Round($Data.ComputerReboots[0].Count / $Data.ActiveLastBootUpTotal * 100))% 793 |
797 | $($Data.ComputerReboots[1].TimePeriod) 798 | 800 | $($Data.ComputerReboots[1].Count) 801 | 803 | $([Math]::Round($Data.ComputerReboots[1].Count / $Data.ActiveLastBootUpTotal * 100))% 804 |
808 | $($Data.ComputerReboots[2].TimePeriod) 809 | 811 | $($Data.ComputerReboots[2].Count) 812 | 814 | $([Math]::Round($Data.ComputerReboots[2].Count / $Data.ActiveLastBootUpTotal * 100))% 815 |
819 | $($Data.ComputerReboots[3].TimePeriod) 820 | 822 | $($Data.ComputerReboots[3].Count) 823 | 825 | $([Math]::Round($Data.ComputerReboots[3].Count / $Data.ActiveLastBootUpTotal * 100))% 826 |
830 | $($Data.ComputerReboots[4].TimePeriod) 831 | 833 | $($Data.ComputerReboots[4].Count) 834 | 836 | $([Math]::Round($Data.ComputerReboots[4].Count / $Data.ActiveLastBootUpTotal * 100))% 837 |
840 |
* Percentage is calculated from the total number of active clients that have a known last bootup time ($($Data.ActiveLastBootUpTotal))
841 | "@ 842 | #endregion 843 | 844 | #region Client Health Thresholds 845 | $Query = " 846 | SELECT * 847 | FROM v_CH_Settings 848 | where SettingsID = 1 849 | " 850 | 851 | $Data.CHSettings = Get-SQLData -Query $Query 852 | 853 | # Set html 854 | $html = $html + @" 855 |

856 |

Client Status Settings

857 | 858 | 859 | 860 | 861 | 862 |
SettingDays
863 | "@ 864 | 865 | $html = $html + @" 866 | 867 | 868 | 871 | 874 | 875 | 876 | 879 | 882 | 883 | 884 | 887 | 890 | 891 | 892 | 895 | 898 | 899 | 900 | 903 | 906 | 907 | 908 |
869 | Heartbeat Discovery 870 | 872 | $($data.CHSettings.DDRInactiveInterval) 873 |
877 | Hardware Inventory 878 | 880 | $($data.CHSettings.HWInactiveInterval) 881 |
885 | Software Inventory 886 | 888 | $($data.CHSettings.SWInactiveInterval) 889 |
893 | Policy Requests 894 | 896 | $($data.CHSettings.PolicyInactiveInterval) 897 |
901 | Status History Retention 902 | 904 | $($data.CHSettings.CleanUpInterval) 905 |
909 | "@ 910 | #endregion 911 | 912 | 913 | # Close html document 914 | $html = $html + @" 915 | 916 | 917 | "@ 918 | 919 | # Send email 920 | Send-MailMessage @EmailParams -Body $html -BodyAsHtml --------------------------------------------------------------------------------