-
Notifications
You must be signed in to change notification settings - Fork 2
/
AnalyseData.ps1
10476 lines (9484 loc) · 692 KB
/
AnalyseData.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<#
.SYNOPSIS
Analyse ConfigMgr Data collected by the CollectData.ps1 and report health check
.DESCRIPTION
Analyse ConfigMgr Data collected by the CollectData.ps1 and report health check
.PARAMETER SaveToFolder
Folder that contains all the XML files used by the collect data script and where the HealthCheck.xml file will be saved
.PARAMETER CategoriesFilePath
Path for the Categories.xml file
This file contain all the categories used by the tool
.PARAMETER IssuesFilePath
Path for the Issues.xml file
This file contain all the text issues used by the tool
.PARAMETER RecommendationsFilePath
Path for the Recommendations.xml file
This file contain all recommendations that the toll will provide for a fix.
This file should contain:
For any issue the tool identify and is aware, an ID starting with 5 should be used. ie 5001 - Upgrade ConfigMgr to the latest version.
For any issue found by ConfigMgr (i.e. Component Staus errors or warning), a 99 should be added to the messageID. ie. if the messageID is 2388, a recommendation id 992388 should be created. This is only used by rules 308 and 363
<?xml version="1.0" encoding="utf-8" ?>
<Recommendations>
<Recommendation id="5001" module="ConfigMgr" name="Issue the tool identified and I the solution want the user to see" />
<Recommendation id="992388" module="ConfigMgr" name="Issue identified by ConfigMgr and the solution i want the user to see" />
</Recommendations>
.PARAMETER RulesOverrideFilePath
Path for the ConfigMgrRulesOverride.xml file
This file contain all the overrides for the rules that can be changed from the default values (i.e. Enabled True/False, Category, Classifications and Criticality)
<?xml version="1.0" encoding="utf-8" ?>
<Rules>
<Rule ID="0" Name="Default Rule" Category="1" Classification="ERROR" Criticality="High" Enabled="True" />
</Rules>
.PARAMETER DefaultValuesOverrideFilePath
Path for the ConfigMgrDefaultValues.xml file
This file contain all the default values used by the tool and can be changed if required
if there is no changes to the default values, a file with the following information should be used:
<?xml version="1.0" encoding="utf-8" ?>
<DefaultValues>
<DefaultValue Name="DefaultValue" Type="int" value="1" />
</DefaultValues>
.INPUTS
None
.OUTPUTS
None
.NOTES
Author: Raphael Perez ([email protected])
Website: http://www.endpointmanagers.com
WebSite: https://github.com/dotraphael/HealthCheckToolkit_Community
Twitter: @dotraphael
DateCreated: 24/10/2013 (v0.1)
Update: 05/11/2014 (v0.2)
Update: 22/06/2015 (v0.3)
Update: 04/02/2016 (v0.4)
Update: 12/05/2017 (v0.5)
Update: 03/08/2018 (v1.0)
Update: 28/08/2018 (v1.1)
Update: 10/09/2018 (v1.2)
Update: 28/09/2018 (v1.3)
Update: 14/12/2018 (v1.4)
Update: 03/05/2019 (v1.5)
Update: 01/10/2019 (v1.6)
Update: 19/05/2020 (v1.7)
Update: 26/02/2021 (v1.8)
Update: 26/02/2021 (v1.9)
Update: 17/02/2022 (v2.0)
Update: 28/03/2022 (v2.1)
- Removed need for HealthCheckClasses.dll
- updated rule 286 addind Application & DTName information
- Clean up Issues.xml
Test:
CM2111 Primary site installed on a WS2016
CM2107 Primary site installed on a WS2019
Requirements:
ConfigMgr Console must be installed and connected to the ConfigMgr infrastructure to be able to run the tool
ConfigMgr Primary Site environment. CAS is not supported
.LINK
http://www.endpointmanagers.com
http://www.rflsystems.co.uk
https://github.com/dotraphael/HealthCheckToolkit_Community
.EXAMPLE
Run the tool against files located into default location and use files Categories, Issues.xml, Recommendations.xml ConfigMgrrulesoverride.xml and ConfigMgrdefaultvalues.xml located on the same folder as the script
and will save all the healthcheck.xml file into default location 'C:\Temp\ConfigMgrHealthCheck'
.\AnalyseData.ps1 -CategoriesFilePath .\Categories.xml -IssuesFilePath .\Issues.xml -RecommendationsFilePath .\Recommendations.xml -RulesOverrideFilePath .\ConfigMgrRulesOverride.xml -DefaultValuesOverrideFilePath .\ConfigMgrDefaultValues.xml
.EXAMPLE
Run the tool against files located into 'C:\Temp\ConfigMgrHealthCheckNewLocation' and use files Categories, Issues.xml, Recommendations.xml ConfigMgrrulesoverride.xml and ConfigMgrdefaultvalues.xml located on the same folder as the script
and will save all the healthcheck.xml file into default location 'C:\Temp\ConfigMgrHealthCheckNewLocation'
.\AnalyseData.ps1 -CategoriesFilePath .\Categories.xml -IssuesFilePath .\Issues.xml -RecommendationsFilePath .\Recommendations.xml -RulesOverrideFilePath .\ConfigMgrRulesOverride.xml -DefaultValuesOverrideFilePath .\ConfigMgrDefaultValues.xml -SaveToFolder 'C:\Temp\ConfigMgrHealthCheckNewLocation'
#>
#region param
[CmdletBinding()]param (
$SaveToFolder = 'C:\Temp\ConfigMgrHealthCheck',
[parameter(Mandatory=$true)][ValidateScript({If(Test-Path -LiteralPath $_){$true}else{Throw "Invalid Message File Path given: $_"}})][string]$CategoriesFilePath,
[parameter(Mandatory=$true)][ValidateScript({If(Test-Path -LiteralPath $_){$true}else{Throw "Invalid Message File Path given: $_"}})][string]$IssuesFilePath,
[parameter(Mandatory=$true)][ValidateScript({If(Test-Path -LiteralPath $_){$true}else{Throw "Invalid Message File Path given: $_"}})][string]$RecommendationsFilePath,
[parameter(Mandatory=$true)][ValidateScript({If(Test-Path -LiteralPath $_){$true}else{Throw "Invalid Rules Override File Path given: $_"}})][string]$RulesOverrideFilePath,
[parameter(Mandatory=$true)][ValidateScript({If(Test-Path -LiteralPath $_){$true}else{Throw "Invalid Default Values Override File Path given: $_"}})][string]$DefaultValuesOverrideFilePath
)
#endregion
#region Starting Script, Verbose variables
$Global:ErrorCapture = @()
$Script:StartDateTime = get-date
if ($Verbose) {
$DebugPreference = 2
$VerbosePreference = 2
$WarningPreference = 2
}
$Error.Clear()
$ErrorActionPreference = "Continue"
#endregion
#region Import class DLL
Add-Type -Assembly System.IO.Compression.FileSystem | Out-Null
#endregion
#region Functions
#region Test-RFLAdministrator
Function Test-RFLAdministrator {
<#
.SYSNOPSIS
Check if the current user is member of the Local Administrators Group
.DESCRIPTION
Check if the current user is member of the Local Administrators Group
.NOTES
Name: Test-RFLAdministrator
Author: Raphael Perez
DateCreated: 28 November 2019 (v0.1)
.EXAMPLE
Test-RFLAdministrator
#>
$currentUser = [Security.Principal.WindowsIdentity]::GetCurrent()
(New-Object Security.Principal.WindowsPrincipal $currentUser).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
#endregion
#region Add-RFLHealthCheckIssueList
Function Add-RFLHealthCheckIssueList
{
[cmdletbinding()]
Param(
[Parameter(Mandatory=$True)]$RuleIDInfo,
[Parameter(Mandatory=$false)][int]$IncrementValue = 1
)
[string]$Category = Get-RFLHealthCheckCategory $RuleIDInfo.Category
[string]$Classification = $RuleIDInfo.Classification.ToUpper()
$varName = "Cat$($RuleIDInfo.Category)$($RuleIDInfo.Classification.ToUpper())"
$varInfo = (Get-Variable $varName -ErrorAction SilentlyContinue)
if ($null -eq $varInfo) {
$varValue = 0
} else {
$varValue = $varInfo.Value
}
$newValue = ($varValue + $IncrementValue)
Set-Variable -Name "$varName" -Value ($newValue)
}
#endregion
#region Convert-CMSchedule
Function Convert-CMSchedule
{
[cmdletbinding()]
Param(
[Parameter(
ValueFromPipeline=$true,
Mandatory=$True
)]
$ScheduleString
)
#source: https://tech.xenit.se/convert-sccm-schedule-readable-format/
Begin{
}
Process{
$Start = $ScheduleString.Substring(0,8)
$Recurrence = $ScheduleString.Substring(8,8)
If($Start -eq '00012000'){
$Type = 'Simple'
}
Else{
$Type = 'Custom'
#Convert to binary string
$BStart = [Convert]::ToString([int64]"0x$Start".ToString(),2)
#Pad to 32 chars
If($BStart.Length -lt 32){0..(31-$BStart.Length) | ForEach-Object{$Bstart = "0$BStart"}}
#Collect timedata
[String]$StartMinute = [Convert]::ToInt32($BStart.Substring(0,6),2)
If($StartMinute.Length -eq 1){$StartMinute = "0$StartMinute"}
[String]$StartHour = [Convert]::ToInt32($BStart.Substring(6,5),2)
If($StartHour.Length -eq 1){$StartHour = "0$StartHour"}
[String]$StartDay = [Convert]::ToInt32($BStart.Substring(11,5),2)
If($StartDay.Length -eq 1){$StartDay = "0$StartDay"}
[String]$StartMonth = [Convert]::ToInt32($BStart.Substring(16,4),2)
If($StartMonth.Length -eq 1){$StartMonth = "0$StartMonth"}
[String]$StartYear = [Convert]::ToInt32($BStart.Substring(20,6),2)+1970
$StartString = "$StartYear-$StartMonth-$StartDay $StartHour`:$StartMinute`:00"
}
#Convert to binary string
$BRec = [Convert]::ToString([int64]"0x$Recurrence".ToString(),2)
#Pad to 32 chars
If($BRec.Length -lt 32){0..(31-$BRec.Length) | ForEach-Object{$BRec = "0$BRec"}}
[bool]$GMT = [Convert]::ToInt32($BRec.Substring(31,1),2)
$DayDuration = 0
$HourDuration = [Convert]::ToInt32($BRec.Substring(0,5),2)
$MinuteDuration = [Convert]::ToInt32($BRec.Substring(5,5),2)
If($HourDuration -gt 24){
$h = $HourDuration % 24
$DayDuration = ($HourDuration-$h)/24
$HourDuration = $h
}
$RecurType = [Convert]::ToInt32($BRec.Substring(10,3),2)
Switch($RecurType){
1{
$path = 'SMS_ST_NonRecurring'
##??
}
2{
$path = 'SMS_ST_RecurInterval'
$MinuteSpan = [Convert]::ToInt32($BRec.Substring(13,6),2)
$HourSpan = [Convert]::ToInt32($BRec.Substring(19,5),2)
$DaySpan = [Convert]::ToInt32($BRec.Substring(24,5),2)
$Ret = '#TYPE IResultObject#SMS_ST_RecurInterval
"SmsProviderObjectPath","DayDuration","DaySpan","HourDuration","HourSpan","IsGMT","MinuteDuration","MinuteSpan","StartTime","PSComputerName","PSShowComputerName"
"SMS_ST_RecurInterval","{0}","{1}","{2}","{3}","{4}","{5}","{6}","1970-02-01 00:00:00","{7}","False"' -f $DayDuration,$DaySpan,$HourDuration,$HourSpan,$GMT,$MinuteDuration,$MinuteSpan,$env:COMPUTERNAME | ConvertFrom-Csv
}
3{
$path = 'SMS_ST_RecurWeekly'
$Day = [Convert]::ToInt32($BRec.Substring(13,3),2)
$ForNumberOfWeeks = [Convert]::ToInt32($BRec.Substring(16,3),2)
$ret = '#TYPE IResultObject#SMS_ST_RecurWeekly
"SmsProviderObjectPath","Day","DayDuration","ForNumberOfWeeks","HourDuration","IsGMT","MinuteDuration","StartTime","PSComputerName","PSShowComputerName"
"SMS_ST_RecurWeekly","{0}","{1}","{2}","{3}","{4}","{5}","{6}","{7}","False"' -f $Day,$DayDuration,$ForNumberOfWeeks,$HourDuration,$GMT,$MinuteDuration,$StartString,$env:COMPUTERNAME | ConvertFrom-Csv
}
4{
$path = 'SMS_ST_RecurMonthlyByWeekday'
$Day = [Convert]::ToInt32($BRec.Substring(13,3),2)
$ForNumberOfMonths = [Convert]::ToInt32($BRec.Substring(16,4),2)
$WeekOrder = [Convert]::ToInt32($BRec.Substring(20,3),2)
$ret = '#TYPE IResultObject#SMS_ST_RecurMonthlyByWeekday
"SmsProviderObjectPath","Day","DayDuration","ForNumberOfMonths","HourDuration","IsGMT","MinuteDuration","StartTime","WeekOrder","PSComputerName","PSShowComputerName"
"SMS_ST_RecurMonthlyByWeekday","{0}","{1}","{2}","{3}","{4}","{5}","{6}","{7}","{8}","False"' -f $Day,$DayDuration,$ForNumberOfMonths,$HourDuration,$GMT,$MinuteDuration,$StartString,$WeekOrder,$env:COMPUTERNAME | ConvertFrom-Csv
}
5{
$path = 'SMS_ST_RecurMonthlyByDate'
$MonthDay = [Convert]::ToInt32($BRec.Substring(13,5),2)
$ForNumberOfMonths = [Convert]::ToInt32($BRec.Substring(18,4),2)
$Ret = '#TYPE IResultObject#SMS_ST_RecurMonthlyByDate
"SmsProviderObjectPath","DayDuration","ForNumberOfMonths","HourDuration","IsGMT","MinuteDuration","MonthDay","StartTime","PSComputerName","PSShowComputerName"
"SMS_ST_RecurMonthlyByDate","{0}","{1}","{2}","{3}","{4}","{5}","{6}","{7}","False"' -f $DayDuration,$ForNumberOfMonths,$HourDuration,$GMT,$MinuteDuration,$MonthDay,$StartString,$env:COMPUTERNAME | ConvertFrom-Csv
}
6{
$path = '???'
##??
}
Default{
Write-RFLLog -LogType 'ERROR' -LogMessage "Invalid type $RecurType for $ScheduleString"
}
}
$Ret
}
End{
}
}
#endregion
#region Convert-CMscheduleToMinutes
Function Convert-CMScheduleObjectToMinutes
{
[cmdletbinding()]
Param(
[Parameter(
ValueFromPipeline=$true,
Mandatory=$True
)]
$ScheduleObject
)
switch ($ScheduleObject.SmsProviderObjectPath) {
'SMS_ST_RecurMonthlyByDate' { $scheduleToMinutes = ([int]($ScheduleObject.ForNumberOfMonths) * 30 * 24 * 60) }
'SMS_ST_RecurMonthlyByWeekday' { $scheduleToMinutes = ([int]($ScheduleObject.ForNumberOfMonths) * 30 * 24 * 60) }
'SMS_ST_RecurWeekly' { $scheduleToMinutes = ([int]($ScheduleObject.ForNumberOfWeeks) * 7 * 24 * 60) }
'SMS_ST_RecurInterval' { $scheduleToMinutes = ([int]($ScheduleObject.DaySpan) * 24 * 60) + ([int]($ScheduleObject.HourSpan) * 60) + ([int]($ScheduleObject.MinuteSpan)) }
'SMS_ST_NonRecurring' { $scheduleToMunites = [int]0 }
Default{ Throw "Invalid type $($ScheduleObject.SmsProviderObjectPath)" }
}
$scheduleToMinutes
}
#endregion
#region Get-RFLHealthCheckCategory
function Get-RFLHealthCheckCategory {
param (
[Parameter(Mandatory=$true)][int]$MessageID
)
$return = ($Script:HealthCheckCategoryData.Categories.Category | Where-Object {($_.id -eq $MessageID) -and ($_.module -eq 'ConfigMgr')}).Name
if ($null -eq $return) {
$Return = "Unknown Category with message ID $($MessageID)"
}
return $return
}
#endregion
#region Get-RFLHealthCheckIssue
function Get-RFLHealthCheckIssue {
param (
[Parameter(Mandatory=$true)][int]$MessageID,
[Parameter(Mandatory=$false)][object[]]$MessageParameters
)
$return = ($Script:HealthCheckIssuesData.Issues.issue | Where-Object {($_.id -eq $MessageID) -and ($_.module -eq 'ConfigMgr')}).Name
if ($null -eq $return) {
$Return = "Unknown Issue with message ID $($MessageID)"
} else {
if (($MessageParameters.Count -gt 0) -and ($return.IndexOf('{0}') -ge 0)) {
try {
$return = $return -f $MessageParameters
} catch {
$Global:ErrorCapture += $_
Write-RFLLog -LogType 'ERROR' -LogMessage "Message with Error: $MessageID"
throw $_
}
}
}
#return "something $messageID - $return"
return $return
}
#endregion
#region Get-RFLHealthCheckRecommendation
function Get-RFLHealthCheckRecommendation {
param (
[Parameter(Mandatory=$true)][int]$MessageID,
[Parameter(Mandatory=$false)][object[]]$MessageParameters
)
$return = ($Script:HealthCheckRecommendationData.Recommendations.Recommendation | Where-Object {($_.id -eq $MessageID) -and ($_.module -eq 'ConfigMgr')}).Name
if ([string]::IsNullOrEmpty($return)) {
#$Return = ""
$Return = "Unknown Recommendation with message ID $($MessageID)"
} else {
if (($MessageParameters.Count -gt 0) -and ($return.IndexOf('{0}') -ge 0)) {
try {
$return = $return -f $MessageParameters
} catch {
$Global:ErrorCapture += $_
Write-RFLLog -LogType 'ERROR' -LogMessage "Message with Error: $MessageID"
throw $_
}
}
}
return $return
}
#endregion
#region Get-RFLCollectionNames
function Get-RFLCollectionNames {
param (
[Parameter(Mandatory=$true)]$CollectionList
)
(($CollectionList | select-Object Name -unique) | Foreach {"'$($_.Name.Trim())'"}) -join ' '
}
#endregion
#region Set-RFLHealthCheckDefaultValue
function Set-RFLHealthCheckDefaultValue {
param (
[Parameter(Mandatory=$true)][string]$ValueName,
[Parameter(Mandatory=$true)]$ValueNonExist
)
$ValueDetails = $Script:HealthCheckDefaultValueData.DefaultValues.DefaultValue | Where-Object {$_.Name -eq $ValueName}
if ($null -eq $ValueDetails) {
New-Variable -Name $ValueName -Value $ValueNonExist -Force -Option AllScope -Scope Script
#Write-RFLLog -LogType 'INFO' -LogMessage "$ValueName is now set to default value of $((Get-Variable $ValueName).Value)"
} else {
if ($ValueDetails -is [array]) {
$ValueDetails = $ValueDetails[0]
}
if ($ValueDetails.Type.tolower() -eq 'array') {
New-Variable -Name $ValueName -Value $ValueDetails.value.Split(',') -Force -Option AllScope -Scope Script
} else {
New-Variable -Name $ValueName -Value $ValueDetails.value -Force -Option AllScope -Scope Script
}
Write-RFLLog -LogType 'INFO' -LogMessage "$ValueName is now set to custom default value of $((Get-Variable $ValueName).Value)"
}
}
#endregion
#region Set-RFLHealthCheckRulesOverride
function Set-RFLHealthCheckRulesOverride {
param (
[Parameter(Mandatory=$true)][int]$RuleID,
[Parameter(Mandatory=$true)][string]$RuleName,
[Parameter(Mandatory=$true)][int]$DefaultCategory,
[Parameter(Mandatory=$true)][string]$Criticality,
[Parameter(Mandatory=$true)][string]$DefaultClassification
)
$ValueDetails = $Script:HealthCheckRulesOverrideData.Rules.Rule | Where-Object {$_.ID -eq $RuleID}
$VariableName = "RuleID$($RuleID)"
$objRule = New-Object -TypeName PSObject -Property @{'ID' = $RuleID; 'Name' = $RuleName; 'Category' = $DefaultCategory; 'Classification' = $DefaultClassification;'Criticality'=$Criticality;'Enabled'=$true }
#$objRule = new-object HealthCheckClasses.HealthCheck.CEClassRules($RuleID, $RuleName, $DefaultCategory, $DefaultClassification, $Criticality, $true)
$ShowMsg = $false
if ($null -ne $ValueDetails) {
if ($ValueDetails -is [array]) {
$ValueDetails = $ValueDetails[0]
}
$objRule.Category = $ValueDetails.Category
$objRule.Classification = $ValueDetails.Classification
$objRule.Criticality = $ValueDetails.Criticality
$objRule.Enabled = [Convert]::ToBoolean($ValueDetails.Enabled)
$ShowMsg = $true
}
New-Variable -Name $VariableName -Value $objRule -Force -Option AllScope -Scope Script
if ($ShowMsg) {
Write-RFLLog -LogType 'INFO' -LogMessage "Rule ID $($RuleID) information is set to custom values of Category: $((Get-Variable $VariableName).Value.Category), Classification: $((Get-Variable $VariableName).Value.Classification), Enabled: $((Get-Variable $VariableName).Value.Enabled)"
}
}
#endregion
#region Write-RFLHealthCheckData
function Write-RFLHealthCheckData {
PARAM (
[Parameter(Mandatory=$true)][string]$Description,
[Parameter(Mandatory=$false)][string]$Comment,
[Parameter(Mandatory=$true)]$RuleIDInfo
)
$newRow = $Script:HealthCheckData.NewRow()
$newRow.Category = Get-RFLHealthCheckCategory $RuleIDInfo.Category
$newRow.Classification = $RuleIDInfo.Classification
$newRow.Description = $Description.Trim()
$newRow.Comment = $Comment.Trim()
$newRow.RuleID = $RuleIDInfo.ID
$newRow.CategoryID = $RuleIDInfo.Category
$newRow.RuleName = $ruleIDInfo.Name
$newRow.Criticality = $RuleIDInfo.Criticality
switch ($RuleIDInfo.Criticality.ToUpper()) {
"HIGH" {
$newRow.CriticalityID = 1
}
"MEDIUM" {
$newRow.CriticalityID = 2
}
default {
$newRow.CriticalityID = 3
}
}
$Script:HealthCheckData.Rows.Add($newRow)
Write-RFLLog -logtype "$($newRow.Classification)" -logmessage "$($newRow.Category) - $Description"
}
#endregion
#region Test-RFLHealthCheckCollectData
function Test-RFLHealthCheckCollectData {
param (
[Parameter(Mandatory=$true)][int[]]$Rules
)
$enabledRules = ""
foreach($item in $Rules) {
$RuleInfo = (Get-Variable "RuleID$($item)" -ErrorAction SilentlyContinue).Value
if ($RuleInfo.Enabled -eq $true) {
if (-not [string]::IsNullOrEmpty($enabledRules)) { $enabledRules += ', '}
$enabledRules += $item
}
}
if ([string]::IsNullOrEmpty($enabledRules)) {
return $false
} else {
return $true
}
}
#endregion
#region Clear-RFLLog
Function Clear-RFLLog {
<#
.SYSNOPSIS
Delete the log file if bigger than maximum size
.DESCRIPTION
Delete the log file if bigger than maximum size
.NOTES
Name: Clear-RFLLog
Author: Raphael Perez
DateCreated: 28 November 2019 (v0.1)
.EXAMPLE
Clear-RFLLog -maxSize 2mb
#>
param (
[Parameter(Mandatory = $true)][string]$maxSize
)
try {
if(Test-Path -Path $script:ScriptLogFilePath) {
if ((Get-Item $script:ScriptLogFilePath).length -gt $maxSize) {
Remove-Item -Path $script:ScriptLogFilePath
Start-Sleep -Seconds 1
}
}
}
catch {
Write-RFLLog -Message "Unable to delete log file." -LogLevel 3
}
}
#endregion
#region Get-ScriptDirectory
function Get-ScriptDirectory {
<#
.SYSNOPSIS
Get the directory of the script
.DESCRIPTION
Get the directory of the script
.NOTES
Name: ClearGet-ScriptDirectory
Author: Raphael Perez
DateCreated: 28 November 2019 (v0.1)
.EXAMPLE
Get-ScriptDirectory
#>
Split-Path -Parent $PSCommandPath
}
#endregion
#region Set-RFLLogPath
Function Set-RFLLogPath {
<#
.SYSNOPSIS
Configures the full path to the log file depending
.DESCRIPTION
Configures the full path to the log file depending
.NOTES
Name: Set-RFLLogPath
Author: Raphael Perez
DateCreated: 28 November 2019 (v0.1)
.EXAMPLE
Set-RFLLogPath
#>
if ([string]::IsNullOrEmpty($script:LogFilePath)) {
$script:LogFilePath = $env:Temp
}
$script:ScriptLogFilePath = "$($script:LogFilePath)\$($Script:LogFileFileName)"
}
#endregion
#region Write-RFLLog
function Write-RFLLog {
<#
.SYSNOPSIS
Write the log file if the global variable is set
.DESCRIPTION
Write the log file if the global variable is set
.PARAMETER LogMessage
Message to write to the log
.PARAMETER LogType
Log Level Information, Warning, Error or Exception
.NOTES
Name: Write-RFLLog
Author: Raphael Perez
DateCreated: 28 November 2019 (v0.1)
Update: 23 February 2022 (v0.2)
.EXAMPLE
Write-RFLLog -LogMessage 'This is an information message'
.EXAMPLE
Write-RFLLog -LogMessage 'This is a warning message' -LogType 'WARNING'
.EXAMPLE
Write-RFLLog -LogMessage 'This is an error message' -LogType 'ERROR'
#>
PARAM (
[Parameter(Mandatory=$false)]
[ValidateSet('EXCEPTION', 'ERROR', 'WARNING', 'INFO')]
[string]
$LogType = 'INFO',
[Parameter(Mandatory=$true)]
[string]
$LogMessage
)
$DateTime = Get-Date
$MessageToWrite = "$($LogType.ToUpper()): $($DateTime.ToString('dd/MM/yyyy HH:mm:ss')) - $($LogMessage)"
$MessageToWrite | Out-File -FilePath $script:ScriptLogFilePath -Append -NoClobber -Encoding default
switch ($LogType.ToUpper()) {
"EXCEPTION" {
write-host $MessageToWrite -ForegroundColor Red -BackgroundColor White
#send analytics info
}
"ERROR" {
write-host $MessageToWrite -ForegroundColor Red
}
"WARNING" {
Write-Host $MessageToWrite -ForegroundColor Yellow
}
default {
write-Host $MessageToWrite
}
}
}
#endregion
#endregion
#region Variables
$script:ScriptVersion = '2.1'
$script:LogFilePath = $env:Temp
$Script:LogFileFileName = 'AnalyseData.log'
$script:ScriptLogFilePath = "$($script:LogFilePath)\$($Script:LogFileFileName)"
#endregion
#region Main Script
try {
Set-RFLLogPath
Clear-RFLLog 25mb
Write-RFLLog -logtype "Info" -logmessage "*** Starting ***"
Write-RFLLog -logtype "Info" -logmessage "Script version $script:ScriptVersion"
Write-RFLLog -logtype "Info" -logmessage "Running as $env:username $(if(Test-RFLAdministrator) {"[Administrator]"} Else {"[Not Administrator]"}) on $($env:computername)"
$PSCmdlet.MyInvocation.BoundParameters.Keys | ForEach-Object {
Write-RFLLog -logtype "Info" -logmessage "Parameter '$($_)' is '$($PSCmdlet.MyInvocation.BoundParameters.Item($_))'"
}
#region Categories ID's
Write-RFLLog -logtype "Info" -logmessage "Categories Database"
$Script:HealthCheckCategoryData = [xml](get-content -path $CategoriesFilePath)
#endregion
#region Issues ID's
Write-RFLLog -logtype "Info" -logmessage "Issues Database"
$Script:HealthCheckIssuesData = [xml](get-content -path $IssuesFilePath)
#endregion
#region Recommendations ID's
Write-RFLLog -logtype "Info" -logmessage "Recommendation Database"
$Script:HealthCheckRecommendationData = [xml](get-content -path $RecommendationsFilePath)
#endregion
#region Default Values
Write-RFLLog -logtype "Info" -logmessage "Default Values Database"
$Script:HealthCheckDefaultValueData = [xml](get-content -path $DefaultValuesOverrideFilePath)
#endregion
#region Rules Override
Write-RFLLog -logtype "Info" -logmessage "Rules Override Database"
$Script:HealthCheckRulesOverrideData = [xml](get-content -path $RulesOverrideFilePath)
#endregion
#region Set Default Variables
Write-RFLLog -logtype "Info" -logmessage "Setting Default Check Variables"
1..25 | foreach {
Set-RFLHealthCheckDefaultValue -ValueName "Cat$($_)ERROR" -ValueNonExist 0
Set-RFLHealthCheckDefaultValue -ValueName "Cat$($_)WARNING" -ValueNonExist 0
}
Set-RFLHealthCheckDefaultValue -ValueName 'MinimumConfigMgrBuildVersion' -ValueNonExist 9040 #2010 https://docs.microsoft.com/en-us/mem/configmgr/core/servers/manage/updates#version-details
Set-RFLHealthCheckDefaultValue -ValueName 'LatestConfigMgrBuildVersion' -ValueNonExist 9068 #2111 list can be found https://buildnumbers.wordpress.com/sccm/
Set-RFLHealthCheckDefaultValue -ValueName 'LatestWhatsNew' -ValueNonExist 'https://docs.microsoft.com/en-us/mem/configmgr/core/plan-design/changes/whats-new-in-version-2111'
Set-RFLHealthCheckDefaultValue -ValueName 'W10MinBuild' -ValueNonExist 18363 #1909. https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet - build can be found https://docs.microsoft.com/en-gb/windows/release-health/release-information
Set-RFLHealthCheckDefaultValue -ValueName 'MinimumSQLVersion' -ValueNonExist '12.0.6024.0' #2014 sp3 https://docs.microsoft.com/en-us/lifecycle/products/sql-server-2014, https://sqlserverbuilds.blogspot.com/ and https://docs.microsoft.com/en-us/mem/configmgr/core/plan-design/configs/support-for-sql-server-versions
Set-RFLHealthCheckDefaultValue -ValueName 'MinADKVersion' -ValueNonExist '10.1.19041' #https://docs.microsoft.com/en-us/mem/configmgr/core/plan-design/configs/support-for-windows-10#windows-10-adk
#ConfigMgr Build;W10ADK
Set-RFLHealthCheckDefaultValue -ValueName 'ADKMatrix' -ValueNonExist @('9040;10.1.18362/10.1.19041', '9049;10.1.19041', '9058;10.1.19041/10.1.20348/10.1.22000', '9068;10.1.19041/10.1.20348/10.1.22000')
Set-RFLHealthCheckDefaultValue -ValueName 'ClientSettingsListName' -ValueNonExist @('BackgroundIntelligentTransfer', 'ClientCache', 'ClientPolicy', 'Cloud', 'ComplianceSettings', 'ComputerAgent', 'ComputerRestart', 'EndpointProtection', 'HardwareInventory', 'MeteredNetwork', 'MobileDevice', 'NetworkAccessProtection', 'PowerManagement', 'RemoteTools', 'SoftwareDeployment', 'SoftwareInventory', 'SoftwareMetering', 'SoftwareUpdates', 'StateMessaging', 'UserAndDeviceAffinity', 'DeliveryOptimization', 'SoftwareCenter', 'WindowsAnalytics')
Set-RFLHealthCheckDefaultValue -ValueName 'MinBootVersion' -ValueNonExist '10.0.18363'
Set-RFLHealthCheckDefaultValue -ValueName 'ADPageSize' -ValueNonExist 2000
Set-RFLHealthCheckDefaultValue -ValueName 'ExcludeServers' -ValueNonExist @()
Set-RFLHealthCheckDefaultValue -ValueName 'ProcessListSamplesMinutes' -ValueNonExist 1
Set-RFLHealthCheckDefaultValue -ValueName 'ProcessListSamplesWaitSeconds' -ValueNonExist 10
Set-RFLHealthCheckDefaultValue -ValueName 'MaxCollectionMembershipDirectRule' -ValueNonExist 500
Set-RFLHealthCheckDefaultValue -ValueName 'MinimumSQLMemory' -ValueNonExist '8192'
Set-RFLHealthCheckDefaultValue -ValueName 'MinConfigMgrModuleVersion' -ValueNonExist 5.1702
Set-RFLHealthCheckDefaultValue -ValueName 'MinConfigMgrVersion' -ValueNonExist '1702'
Set-RFLHealthCheckDefaultValue -ValueName 'MaximumNumberOfMPS' -ValueNonExist 15
Set-RFLHealthCheckDefaultValue -ValueName 'RolesThatMustBeInstalledPrimary' -ValueNonExist @('SMS Management Point', 'SMS Distribution Point', 'SMS Fallback Status Point', 'SMS SRS Reporting Point', 'SMS Software Update Point', 'SMS Application Web Service', 'SMS Portal Web Site')
Set-RFLHealthCheckDefaultValue -ValueName 'RulesThatMustBeInstalledSecondary' -ValueNonExist @('SMS Management Point', 'SMS Distribution Point', 'SMS Fallback Status Point', 'SMS Software Update Point')
Set-RFLHealthCheckDefaultValue -ValueName 'HiddenPackages' -ValueNonExist @('Configuration Manager Client Package', 'Configuration Manager Client Piloting Package')
Set-RFLHealthCheckDefaultValue -ValueName 'RolesThatMustNotBeInstalledPrimary' -ValueNonExist @()
Set-RFLHealthCheckDefaultValue -ValueName 'RolesThatMustNotBeInstalledSecondary' -ValueNonExist @()
Set-RFLHealthCheckDefaultValue -ValueName 'DDRMinScheduleInMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'DDRMaxScheduleInMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'ForestDiscoveryMinScheduleInMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'ForestDiscoveryMaxScheduleInMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'SecurityGroupDiscoveryMinScheduleInMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'SecurityGroupDiscoveryMaxScheduleInMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'SecurityGroupDiscoveryMinExpiredLogon' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'SecurityGroupDiscoveryMaxExpiredLogon' -ValueNonExist 90
Set-RFLHealthCheckDefaultValue -ValueName 'SecurityGroupDiscoveryMinPasswordSet' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'SecurityGroupDiscoveryMaxPasswordSet' -ValueNonExist 90
Set-RFLHealthCheckDefaultValue -ValueName 'SystemDiscoveryMinScheduleInMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'SystemDiscoveryMaxScheduleInMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'SystemDiscoveryMinExpiredLogon' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'SystemDiscoveryMaxExpiredLogon' -ValueNonExist 90
Set-RFLHealthCheckDefaultValue -ValueName 'SystemDiscoveryMinPasswordSet' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'SystemDiscoveryMaxPasswordSet' -ValueNonExist 90
Set-RFLHealthCheckDefaultValue -ValueName 'UserMinScheduleInMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'UserMaxScheduleInMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'MinCollectionMembershipEvaluation' -ValueNonExist 5
Set-RFLHealthCheckDefaultValue -ValueName 'MaxCollectionMembershipEvaluation' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'MaxCollectionIncrementalUpdateWarning' -ValueNonExist 125
Set-RFLHealthCheckDefaultValue -ValueName 'MaxCollectionIncrementalUpdateError' -ValueNonExist 200
Set-RFLHealthCheckDefaultValue -ValueName 'MinClientStatusSettingsCleanUpInterval' -ValueNonExist 31
Set-RFLHealthCheckDefaultValue -ValueName 'MaxClientStatusSettingsCleanUpInterval' -ValueNonExist 90
Set-RFLHealthCheckDefaultValue -ValueName 'MinClientStatusSettingsDDRInactiveInterval' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MaxClientStatusSettingsDDRInactiveInterval' -ValueNonExist 21
Set-RFLHealthCheckDefaultValue -ValueName 'MinClientStatusSettingsHWInactiveInterval' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MaxClientStatusSettingsHWInactiveInterval' -ValueNonExist 21
Set-RFLHealthCheckDefaultValue -ValueName 'MinClientStatusSettingsPolicyInactiveInterval' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MaxClientStatusSettingsPolicyInactiveInterval' -ValueNonExist 21
Set-RFLHealthCheckDefaultValue -ValueName 'MinClientStatusSettingsStatusInactiveInterval' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MaxClientStatusSettingsStatusInactiveInterval' -ValueNonExist 21
Set-RFLHealthCheckDefaultValue -ValueName 'MinClientStatusSettingsSWInactiveInterval' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MaxClientStatusSettingsSWInactiveInterval' -ValueNonExist 21
Set-RFLHealthCheckDefaultValue -ValueName 'MinCacheSize' -ValueNonExist 5120
Set-RFLHealthCheckDefaultValue -ValueName 'MinPolicyRequestAssignmentTimeout' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'MaxPolicyRequestAssignmentTimeout' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'MinRebootLogoffNotificationCountdownDuration' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MaxRebootLogoffNotificationCountdownDuration' -ValueNonExist 720
Set-RFLHealthCheckDefaultValue -ValueName 'MinRebootLogoffNotificationFinalWindow' -ValueNonExist 15
Set-RFLHealthCheckDefaultValue -ValueName 'MaxRebootLogoffNotificationFinalWindow' -ValueNonExist 90
Set-RFLHealthCheckDefaultValue -ValueName 'MinHardwareInventoryScheduleMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'MaxHardwareInventoryScheduleMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'MinSoftwareInventoryScheduleMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'MaxSoftwareInventoryScheduleMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'MinSoftwareDeploymentEvaluationScheduleMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'MaxSoftwareDeploymentEvaluationScheduleMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'MinSoftwareUpdateScanScheduleMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'MaxSoftwareUpdateScanScheduleMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'MinSoftwareUpdateReScanScheduleMinutes' -ValueNonExist 1440
Set-RFLHealthCheckDefaultValue -ValueName 'MaxSoftwareUpdateReScanScheduleMinutes' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'MinFallbackDPBoundaryGroupRelationship' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'MaxFallbackDPBoundaryGroupRelationship' -ValueNonExist 240
Set-RFLHealthCheckDefaultValue -ValueName 'MinFallbackMPBoundaryGroupRelationship' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'MaxFallbackMPBoundaryGroupRelationship' -ValueNonExist 240
Set-RFLHealthCheckDefaultValue -ValueName 'MinFallbackSMPBoundaryGroupRelationship' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'MaxFallbackSMPBoundaryGroupRelationship' -ValueNonExist 240
Set-RFLHealthCheckDefaultValue -ValueName 'MinFallbackSUPBoundaryGroupRelationship' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'MaxFallbackSUPBoundaryGroupRelationship' -ValueNonExist 240
Set-RFLHealthCheckDefaultValue -ValueName 'DatabaseFreeSpaceMinWarningValueAlert' -ValueNonExist 2
Set-RFLHealthCheckDefaultValue -ValueName 'DatabaseFreeSpaceMaxWarningValueAlert' -ValueNonExist 5
Set-RFLHealthCheckDefaultValue -ValueName 'DatabaseFreeSpaceMinCriticalValueAlert' -ValueNonExist 2
Set-RFLHealthCheckDefaultValue -ValueName 'DatabaseFreeSpaceMaxCriticalValueAlert' -ValueNonExist 3
Set-RFLHealthCheckDefaultValue -ValueName 'AntiMalwareLimitCPUUsageMax' -ValueNonExist 50
Set-RFLHealthCheckDefaultValue -ValueName 'AntiMalwareDeleteQuarantinedFilesMax' -ValueNonExist 120
Set-RFLHealthCheckDefaultValue -ValueName 'AntiMalwareDeleteQuarantinedFilesMin' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'AntiMalwarePolicySettingsListName' -ValueNonExist @('Advanced', 'DefaultActions', 'DefinitionUpdates', 'ExclusionSettings', 'MicrosoftActiveProtectionService', 'RealTimeProtection', 'ScanSettings', 'ScheduledScans', 'ThreatOverrides')
Set-RFLHealthCheckDefaultValue -ValueName 'TotalOfSites' -ValueNonExist 1
Set-RFLHealthCheckDefaultValue -ValueName 'RegExLDAPDiscovery' -ValueNonExist 'LDAP:\/\/DC=(.+[^,])'
Set-RFLHealthCheckDefaultValue -ValueName 'MaxUpdateInSUPGroupWarning' -ValueNonExist 750
Set-RFLHealthCheckDefaultValue -ValueName 'MaxUpdateInSUPGroupError' -ValueNonExist 1000
Set-RFLHealthCheckDefaultValue -ValueName 'MinSUPSummarizationTime' -ValueNonExist 720
Set-RFLHealthCheckDefaultValue -ValueName 'MaxSUPSummarizationTime' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'ADRLastRunMaxTime' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MinSUPAlertTime' -ValueNonExist 4320
Set-RFLHealthCheckDefaultValue -ValueName 'MaxSUPAlertTime' -ValueNonExist 10080
Set-RFLHealthCheckDefaultValue -ValueName 'MaxADRSchedule' -ValueNonExist 43200
Set-RFLHealthCheckDefaultValue -ValueName 'MinADRSchedule' -ValueNonExist 240
Set-RFLHealthCheckDefaultValue -ValueName 'MinClientUpgradeDays' -ValueNonExist 3
Set-RFLHealthCheckDefaultValue -ValueName 'MaxClientUpgradeDays' -ValueNonExist 14
Set-RFLHealthCheckDefaultValue -ValueName 'ForestDiscoveryMaxDiscoveryTime' -ValueNonExist 14
Set-RFLHealthCheckDefaultValue -ValueName 'DatabaseReplicationMaxLagTime' -ValueNonExist 2
Set-RFLHealthCheckDefaultValue -ValueName 'MaxLinkDatabaseReplicationSchedule' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MinLinkDatabaseReplicationSchedule' -ValueNonExist 10
Set-RFLHealthCheckDefaultValue -ValueName 'MaxAppDeploymentSummarization1' -ValueNonExist 720
Set-RFLHealthCheckDefaultValue -ValueName 'MinAppDeploymentSummarization1' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MaxAppDeploymentSummarization2' -ValueNonExist 2880
Set-RFLHealthCheckDefaultValue -ValueName 'MinAppDeploymentSummarization2' -ValueNonExist 720
Set-RFLHealthCheckDefaultValue -ValueName 'MaxAppDeploymentSummarization3' -ValueNonExist 20160
Set-RFLHealthCheckDefaultValue -ValueName 'MinAppDeploymentSummarization3' -ValueNonExist 5040
Set-RFLHealthCheckDefaultValue -ValueName 'MaxAppStatisticsSummarization1' -ValueNonExist 720
Set-RFLHealthCheckDefaultValue -ValueName 'MinAppStatisticsSummarization1' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MaxAppStatisticsSummarization2' -ValueNonExist 2880
Set-RFLHealthCheckDefaultValue -ValueName 'MinAppStatisticsSummarization2' -ValueNonExist 720
Set-RFLHealthCheckDefaultValue -ValueName 'MaxAppStatisticsSummarization3' -ValueNonExist 20160
Set-RFLHealthCheckDefaultValue -ValueName 'MinAppStatisticsSummarization3' -ValueNonExist 5040
Set-RFLHealthCheckDefaultValue -ValueName 'GroupsNotAllowed' -ValueNonExist @('Access Control Assistance Operators', 'Account Operators', 'Administrators', 'Backup Operators', 'Certificate Service DCOM Access', 'Cryptographic Operators', 'Distributed COM Users', 'Event Log Readers', 'Guests', 'Hyper-V Administrators', 'IIS_IUSRS', 'Incoming Forest Trust Builders', 'Network Configuration Operators', 'Performance Log Users', 'Performance Monitor Users', 'Pre-Windows 2000 Compatible Access', 'Print Operators', 'RDS Endpoint Servers', 'RDS Management Servers', 'RDS Remote Access Servers', 'Remote Desktop Users', 'Remote Management Users', 'Replicator', 'Server Operators', 'Storage Replica Administrators', 'System Managed Accounts Group', 'Terminal Server License Servers', 'Windows Authorization Access Group', 'Allowed RODC Password Replication Group', 'Cert Publishers', 'Cloneable Domain Controllers', 'DHCP Administrators', 'DHCP Users', 'DnsAdmins', 'DnsUpdateProxy', 'Domain Admins', 'Domain Computers', 'Domain Controllers', 'Domain Guests', 'Enterprise Admins', 'Enterprise Key Admins', 'Enterprise Read-only Domain Controllers', 'Group Policy Creator Owners', 'Key Admins', 'Protected Users', 'RAS and IAS Servers', 'Read-only Domain Controllers', 'Schema Admins')
Set-RFLHealthCheckDefaultValue -ValueName 'MaxFullAdminWarning' -ValueNonExist 3
Set-RFLHealthCheckDefaultValue -ValueName 'MaxFullAdminError' -ValueNonExist 5
Set-RFLHealthCheckDefaultValue -ValueName 'WarningCPUAverageUsage' -ValueNonExist 50
Set-RFLHealthCheckDefaultValue -ValueName 'ErrorCPUAverageUsage' -ValueNonExist 75
Set-RFLHealthCheckDefaultValue -ValueName 'WarningPercentageFreeSpace' -ValueNonExist 20
Set-RFLHealthCheckDefaultValue -ValueName 'ErrorPercentageFreeSpace' -ValueNonExist 10
Set-RFLHealthCheckDefaultValue -ValueName 'InboxFolderCountWarning' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'InboxFolderCountError' -ValueNonExist 50
Set-RFLHealthCheckDefaultValue -ValueName 'ApplicationFailurePercentageWarning' -ValueNonExist 25
Set-RFLHealthCheckDefaultValue -ValueName 'ApplicationFailurePercentageError' -ValueNonExist 50
Set-RFLHealthCheckDefaultValue -ValueName 'ComponentStatusMessageDateOld' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MaxDPContentValudationSchedule' -ValueNonExist 20160
Set-RFLHealthCheckDefaultValue -ValueName 'MinDPContentValudationSchedule' -ValueNonExist 4320
Set-RFLHealthCheckDefaultValue -ValueName 'IgnoreCloudDP' -ValueNonExist $false
Set-RFLHealthCheckDefaultValue -ValueName 'AddMultipleComponentStatusMessage' -ValueNonExist $false
Set-RFLHealthCheckDefaultValue -ValueName 'MaxApprovalRequestDate' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MinMDTVersion' -ValueNonExist '6.3.8450.1000'
Set-RFLHealthCheckDefaultValue -ValueName 'MaxDistributionInProgressWarning' -ValueNonExist 3
Set-RFLHealthCheckDefaultValue -ValueName 'MaxDistributionInProgressError' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MaxPingResponseTimeWarning' -ValueNonExist 50
Set-RFLHealthCheckDefaultValue -ValueName 'MaxPingResponseTimeError' -ValueNonExist 100
Set-RFLHealthCheckDefaultValue -ValueName 'MaxPingDropPercentWarning' -ValueNonExist 5
Set-RFLHealthCheckDefaultValue -ValueName 'MaxPingDropPercentError' -ValueNonExist 10
Set-RFLHealthCheckDefaultValue -ValueName 'PingDelay' -ValueNonExist 2
Set-RFLHealthCheckDefaultValue -ValueName 'MaxPingCount' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MinScheduleInMinutes' -ValueNonExist 240
Set-RFLHealthCheckDefaultValue -ValueName 'FreeDiskSpacePercentageWarning' -ValueNonExist 20
Set-RFLHealthCheckDefaultValue -ValueName 'FreeDiskSpacePercentageError' -ValueNonExist 10
Set-RFLHealthCheckDefaultValue -ValueName 'MinimumSiteServerRAMGB' -ValueNonExist 8
Set-RFLHealthCheckDefaultValue -ValueName 'MinimumSiteServerCPUCore' -ValueNonExist 8
Set-RFLHealthCheckDefaultValue -ValueName 'MinimumRemoteServerRAMGB' -ValueNonExist 8
Set-RFLHealthCheckDefaultValue -ValueName 'MinimumRemoteServerCPUCore' -ValueNonExist 4
Set-RFLHealthCheckDefaultValue -ValueName 'DeploymentErrorsWarning' -ValueNonExist 5
Set-RFLHealthCheckDefaultValue -ValueName 'DeploymentErrorsError' -ValueNonExist 10
Set-RFLHealthCheckDefaultValue -ValueName 'IISRoles' -ValueNonExist @('SMS Distribution Point','SMS Management Point','SMS Software Update Point','SMS Fallback Status Point','SMS Application Web Service','SMS Portal Web Site')
Set-RFLHealthCheckDefaultValue -ValueName 'IISExecutionTimeOut' -ValueNonExist 7200
Set-RFLHealthCheckDefaultValue -ValueName 'IISmaxRequestLength' -ValueNonExist 20480
Set-RFLHealthCheckDefaultValue -ValueName 'IISLogOldItemsWarning' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'IISLogOldItemsError' -ValueNonExist 60
Set-RFLHealthCheckDefaultValue -ValueName 'IISMaxBandwidth' -ValueNonExist -1
Set-RFLHealthCheckDefaultValue -ValueName 'IISConnectionTimeout' -ValueNonExist 300
Set-RFLHealthCheckDefaultValue -ValueName 'IISMaxConnections' -ValueNonExist 0
Set-RFLHealthCheckDefaultValue -ValueName 'IISWSUSAppPoolCPUResetInterval' -ValueNonExist 900
Set-RFLHealthCheckDefaultValue -ValueName 'IISWSUSAppPoolPingingEnabled' -ValueNonExist $false
Set-RFLHealthCheckDefaultValue -ValueName 'IISWSUSAppPoolAppPoolRecyclePrivateMemory' -ValueNonExist $false
Set-RFLHealthCheckDefaultValue -ValueName 'IISWSUSAppPoolAppPoolQueueLength' -ValueNonExist 30000
Set-RFLHealthCheckDefaultValue -ValueName 'IISWSUSAppPoolRapidFailProtection' -ValueNonExist $false
Set-RFLHealthCheckDefaultValue -ValueName 'IISWSUSAppPoolPeriodicRestartTime' -ValueNonExist 0
Set-RFLHealthCheckDefaultValue -ValueName 'IISWSUSAppPoolPeriodicRestartRequests' -ValueNonExist 0
Set-RFLHealthCheckDefaultValue -ValueName 'DPFeatures' -ValueNonExist 'Internet Information Services,IIS-WebServerRole;World Wide Web Services,IIS-WebServer;Common HTTP Features, IIS-CommonHttpFeatures;Default Document,IIS-DefaultDocument;Directory Browsing,IIS-DirectoryBrowsing;HTTP Errors,IIS-HttpErrors;Static Content,IIS-StaticContent;HTTP Redirection,IIS-HttpRedirect;Health and Diagnostics,IIS-HealthAndDiagnostics;HTTP Logging,IIS-HttpLogging;Performance Features,IIS-Performance;Static Content Compression,IIS-HttpCompressionStatic;Security,IIS-Security;Request Filtering,IIS-RequestFiltering;Windows Authentication,IIS-WindowsAuthentication;Application Development Features,IIS-ApplicationDevelopment;ISAPI Extensions,IIS-ISAPIExtensions;Web Management Tools,IIS-WebServerManagementTools;IIS Management Console,IIS-ManagementConsole;IIS 6 Management Compatibility,IIS-IIS6ManagementCompatibility;IIS Metabase and IIS 6 configuration compatibility,IIS-Metabase;IIS 6 WMI Compatibility,IIS-WMICompatibility;IIS Management Scripts and Tools,IIS-ManagementScriptingTools;Remote Differential Compression API Support,MSRDC-Infrastructure'
Set-RFLHealthCheckDefaultValue -ValueName 'MPFeatures' -ValueNonExist 'Internet Information Services,IIS-WebServerRole;World Wide Web Services,IIS-WebServer;Common HTTP Features,IIS-CommonHttpFeatures;Default Document,IIS-DefaultDocument;Directory Browsing,IIS-DirectoryBrowsing;HTTP Errors,IIS-HttpErrors;Static Content,IIS-StaticContent;HTTP Redirection,IIS-HttpRedirect;Health and Diagnostics,IIS-HealthAndDiagnostics;HTTP Logging,IIS-HttpLogging;Logging Tools,IIS-LoggingLibraries;Request Monitor,IIS-RequestMonitor;Tracing,IIS-HttpTracing;Performance Features,IIS-Performance;Static Content Compression,IIS-HttpCompressionStatic;Security,IIS-Security;Request Filtering,IIS-RequestFiltering;Windows Authentication,IIS-WindowsAuthentication;Application Development Features,IIS-ApplicationDevelopment;.NET Extensibility 3.5,IIS-NetFxExtensibility;.NET Extensibility 4.6,IIS-NetFxExtensibility45;ISAPI Extensions,IIS-ISAPIExtensions;ISAPI Filters,IIS-ISAPIFilter;ASP.NET 3.5,IIS-ASPNET;ASP.NET 4.6,IIS-ASPNET45;Web Management Tools,IIS-WebServerManagementTools;IIS Management Console,IIS-ManagementConsole;IIS 6 Management Compatibility,IIS-IIS6ManagementCompatibility;IIS Metabase and IIS 6 configuration compatibility,IIS-Metabase;IIS 6 WMI Compatibility,IIS-WMICompatibility;IIS Management Scripts and Tools,IIS-ManagementScriptingTools;IIS Management Service,IIS-ManagementService;Background Intelligent Transfer Service (BITS),BITS;Background Intelligent Transfer Service (BITS) Server Extensions for File Upload,BITSExtensions-Upload'
Set-RFLHealthCheckDefaultValue -ValueName 'MaxThreads' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MaxCPULoad' -ValueNonExist 20
Set-RFLHealthCheckDefaultValue -ValueName 'AutoGrowthDateOld' -ValueNonExist 7
Set-RFLHealthCheckDefaultValue -ValueName 'MinSUPGroupSummarizationTime' -ValueNonExist 43200
Set-RFLHealthCheckDefaultValue -ValueName 'MaxSUPGroupSummarizationTime' -ValueNonExist 86400
Set-RFLHealthCheckDefaultValue -ValueName 'MinSUSDBSize' -ValueNonExist 30
Set-RFLHealthCheckDefaultValue -ValueName 'MinConfigMgrDBSize' -ValueNonExist 75
Set-RFLHealthCheckDefaultValue -ValueName 'ConfigMgrDBMinClients' -ValueNonExist 25000
Set-RFLHealthCheckDefaultValue -ValueName 'LimitedCollectionToIgnore' -ValueNonExist @('All Unknown Computers','All Mobile Devices','All Desktop and Server Clients','All Provisioning Devices')
Set-RFLHealthCheckDefaultValue -ValueName 'MaxLimitCollection' -ValueNonExist 1
Set-RFLHealthCheckDefaultValue -ValueName 'MinMaxMifSize' -ValueNonExist 25000000
Set-RFLHealthCheckDefaultValue -ValueName 'AADApplicationExpireWarning' -ValueNonExist 30
#endregion
#region set Override Rules
Set-RFLHealthCheckRulesOverride -RuleID 1 -RuleName 'Server Down' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 2 -RuleName 'Minimum ConfigMgr Build Version' -DefaultCategory 2 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 3 -RuleName 'Latest ConfigMgr Build Version' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 4 -RuleName 'Enforce Enhanced Hash Algorithm' -DefaultCategory 2 -Criticality 'Low' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 5 -RuleName 'Enforce Message Signing' -DefaultCategory 2 -Criticality 'Low' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 6 -RuleName 'Use Encryption' -DefaultCategory 2 -Criticality 'Low' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 7 -RuleName 'Site Alert' -DefaultCategory 2 -Criticality 'Low' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 8 -RuleName 'Database Free Space Warning (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 9 -RuleName 'Database Free Space Warning (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 10 -RuleName 'Database Free Space Error (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 11 -RuleName 'Database Free Space Error (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 12 -RuleName 'List Roles Installed' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 13 -RuleName 'List Roles Not Installed' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 14 -RuleName 'Test MP (MPList) URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 15 -RuleName 'Test MP (MPCert) URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 16 -RuleName 'Test MP (SiteSign Cert) URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 17 -RuleName 'MP Count' -DefaultCategory 6 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 18 -RuleName 'Application Catalog Web Service URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 19 -RuleName 'Application Catalog Web Site URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 20 -RuleName 'SUP (SimpleAuth) URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 21 -RuleName 'SUP (Registration) URL' -DefaultCategory 6 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 22 -RuleName 'Application Catalog Integration' -DefaultCategory 7 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 23 -RuleName 'SQL Server Reporting Services (Reports) URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 24 -RuleName 'SQL Server Reporting Services (ReportServer) URL' -DefaultCategory 1 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 25 -RuleName 'Minimum SQL Server' -DefaultCategory 3 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 26 -RuleName 'Minimum SQL Memory' -DefaultCategory 3 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 27 -RuleName 'Maximum SQL Memory' -DefaultCategory 3 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 28 -RuleName 'SQL Compatibility Level' -DefaultCategory 3 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 29 -RuleName 'SQL Server Installation Folder' -DefaultCategory 3 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 30 -RuleName 'SQL Server Data Folder' -DefaultCategory 3 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 31 -RuleName 'SQL Server Log Folder' -DefaultCategory 3 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 32 -RuleName 'SQL Server Data Folder (Install)' -DefaultCategory 3 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 33 -RuleName 'SQL Server Log Folder (Install)' -DefaultCategory 3 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 34 -RuleName 'SQL Server Data Folder (Log)' -DefaultCategory 3 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 35 -RuleName 'Account Usage' -DefaultCategory 8 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 36 -RuleName 'Account Usage (Software Distribution)' -DefaultCategory 8 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 37 -RuleName 'Account Usage (Admin)' -DefaultCategory 8 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 38 -RuleName 'Client Status (Clean Up) (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 39 -RuleName 'Client Status (Clean Up) (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 40 -RuleName 'Client Status (Heartbeat) (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 41 -RuleName 'Client Status (Heartbeat) (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 42 -RuleName 'Client Status (Hardware) (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 43 -RuleName 'Client Status (Hardware) (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 44 -RuleName 'Client Status (Client Policy) (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 45 -RuleName 'Client Status (Client Policy) (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 46 -RuleName 'Client Status (Status Message) (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 47 -RuleName 'Client Status (Status Message) (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 48 -RuleName 'Client Status (Software) (Higher)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 49 -RuleName 'Client Status (Software) (Lower)' -DefaultCategory 2 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 50 -RuleName 'Enabled Heartbeat Discovery' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 51 -RuleName 'Heartbeat Discovery Schedule (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 52 -RuleName 'Forest Discovery' -DefaultCategory 10 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 53 -RuleName 'Forest Discovery Schedule (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 54 -RuleName 'Forest Discovery AD Boundary' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 55 -RuleName 'Forest Discovery Subnet Boundary' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 56 -RuleName 'Network Discovery' -DefaultCategory 10 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 57 -RuleName 'Security Group Discovery' -DefaultCategory 10 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 58 -RuleName 'Security Group Discovery Schedule (Higher)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 59 -RuleName 'Security Group Discovery Schedule (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 60 -RuleName 'Security Group Discovery Expired Logon' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 61 -RuleName 'Security Group Discovery Expired Logon Days (Higher)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 62 -RuleName 'Security Group Discovery Expired Logon Days (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 63 -RuleName 'Security Group Discovery Expired Password' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 64 -RuleName 'Security Group Discovery Expired Password Days (Higher)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 65 -RuleName 'Security Group Discovery Expired Password Days (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 66 -RuleName 'Security Group Discovery LDAP Count' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 67 -RuleName 'Security Group Discovery LDAP Root' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 68 -RuleName 'System Discovery' -DefaultCategory 10 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 69 -RuleName 'System Discovery Schedule (Higher)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 70 -RuleName 'System Discovery Schedule (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 71 -RuleName 'System Discovery Expired Logon' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 72 -RuleName 'System Discovery Expired Logon Days (Higher)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 73 -RuleName 'System Discovery Expired Logon Days (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 74 -RuleName 'System Discovery Expired Password' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 75 -RuleName 'System Discovery Expired Password Days (Higher)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 76 -RuleName 'System Discovery Expired Password Days (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 77 -RuleName 'System Discovery LDAP Count' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 78 -RuleName 'System Discovery LDAP Root' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 79 -RuleName 'User Discovery' -DefaultCategory 10 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 80 -RuleName 'User Discovery Schedule (Higher)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 81 -RuleName 'User Discovery Schedule (Lower)' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 82 -RuleName 'User Discovery LDAP Count' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 83 -RuleName 'User Discovery LDAP Root' -DefaultCategory 10 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 84 -RuleName 'DP Group Has Members' -DefaultCategory 12 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 85 -RuleName 'DP Group Content In Sync' -DefaultCategory 12 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 86 -RuleName 'Collection Membership Evaluation Schedule (Higher)' -DefaultCategory 11 -Criticality 'Medium' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 87 -RuleName 'Collection Membership Evaluation Schedule (Lower)' -DefaultCategory 11 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 88 -RuleName 'Device Collection Membership Rules Count' -DefaultCategory 11 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 89 -RuleName 'Device Collection Membership Count' -DefaultCategory 11 -Criticality 'Low' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 90 -RuleName 'Device Collection Limited by' -DefaultCategory 11 -Criticality 'High' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 91 -RuleName 'Device Collection Incremental Warning' -DefaultCategory 11 -Criticality 'Medium' -DefaultClassification 'WARNING'
Set-RFLHealthCheckRulesOverride -RuleID 92 -RuleName 'Device Collection Incremental Error' -DefaultCategory 11 -Criticality 'High' -DefaultClassification 'ERROR'
Set-RFLHealthCheckRulesOverride -RuleID 93 -RuleName 'Device Collection Direct Membership Rule Count' -DefaultCategory 11 -Criticality 'Low' -DefaultClassification 'WARNING'