@@ -29,19 +29,23 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
29
30
30
Author(s): Dennis Esly
31
31
Date: 02/02/2017
32
- Last change: 09/04 /2018
33
- Version: 2.0.1
32
+ Last change: 09/12 /2018
33
+ Version: 2.0.2
34
34
35
35
#>
36
36
37
37
Param (
38
38
# The day of week to additionaly send an report by email
39
39
[ValidateSet (0 , 1 , 2 , 3 , 4 , 5 , 6 )]
40
- [int []]$dayOfWeek = 4
40
+ [int []]$dayOfWeek = 4 ,
41
+
42
+ # Switch to get a shortened report
43
+ [switch ]$short
41
44
)
42
45
43
46
# region Imports
44
47
Import-Module MbamExtensionModule - ErrorAction SilentlyContinue
48
+ Import-Module WinSrvExtensionModule - ErrorAction SilentlyContinue
45
49
Import-Module ADExtensionModule - ErrorAction SilentlyContinue
46
50
Import-Module LogFileModule - ErrorAction SilentlyContinue
47
51
@@ -56,7 +60,6 @@ $reportHtmlTitle = "FB Pro GmbH - MBAM-Server report " + (Get-Date -UFormat "%Y%
56
60
57
61
$year = Get-Date - Format " yyyy"
58
62
$month = Get-Date - Format " MM"
59
-
60
63
$reportSavePath = $ConfigFile.Settings.Mbam.Server.ReportPath + " $year \$month \"
61
64
$xmlSavePath = $ConfigFile.Settings.Mbam.Server.XmlPath + " $year \$month \"
62
65
@@ -205,6 +208,7 @@ $passed, $warning, $failed, $counter = 0
205
208
206
209
foreach ($result in $allResults )
207
210
{
211
+
208
212
if ($result.passed -eq 1 ) { $passed ++ }
209
213
elseif ($result.passed -eq 3 ) { $warning ++ }
210
214
elseif ( ($result.passed -eq 2 ) -or ($result.Passed -eq 4 ) ) { $failed ++ }
@@ -354,6 +358,10 @@ $report += New-MbamReportSectionHeader -resultObjects $mbamServerEnvironmentSyst
354
358
$report += $mbamServerEnvironmentSystemsStatus | ConvertTo-TapResultHtmlTable
355
359
356
360
$report += " </table></div>"
361
+
362
+ # if full report is requested, get user login history, update history and SCCM deployment history, otherwise skip this part
363
+ if ($short -ne $true )
364
+ {
357
365
# Add user login history to report
358
366
$report += Get-UserLoginHistory | ConvertTo-Html - Head " " - PreContent " <h3 id=`" 6`" >User Login Histroy (last 7 days)</h3>"
359
367
@@ -362,6 +370,8 @@ $report += Get-UpdateHistory -number 20 | ConvertTo-Html -Head "" -PreContent "<
362
370
363
371
# Add SCCM deployment history to report
364
372
$report += Get-SccmDeploymentHistory - number 20 | ConvertTo-Html - Head " " - PreContent " <h3 id=`" 8`" >Deployment group history (last 20 assignments)</h3>"
373
+ }
374
+
365
375
366
376
# Closing html tags
367
377
$report += " </body></html>"
@@ -421,6 +431,7 @@ if ($ConfigFile.Settings.Mbam.Server.SendReport)
421
431
}
422
432
# endregion
423
433
}
434
+
424
435
# Catch any occured error and write it to log file
425
436
catch
426
437
{
0 commit comments