add: New process for collecting MgGraph output to make pester testing easier
This commit is contained in:
@@ -29,7 +29,6 @@ function Test-MailboxAuditingE3 {
|
||||
# Dot source the class script if necessary
|
||||
#. .\source\Classes\CISAuditResult.ps1
|
||||
|
||||
$e3SkuPartNumber = "SPE_E3"
|
||||
|
||||
$actionDictionaries = Get-Action -Dictionaries
|
||||
# E3 specific actions
|
||||
@@ -38,14 +37,14 @@ function Test-MailboxAuditingE3 {
|
||||
$OwnerActions = $actionDictionaries.OwnerActions.Keys | Where-Object { $_ -notin @("MailItemsAccessed", "Send") }
|
||||
|
||||
$allFailures = @()
|
||||
$founde3Sku = Get-MgSubscribedSku -All | Where-Object { $_.SkuPartNumber -eq $e3SkuPartNumber }
|
||||
$processedUsers = @{} # Dictionary to track processed users
|
||||
$recnum = "6.1.2"
|
||||
$allUsers = Get-MgOutput -Rec $recnum
|
||||
$processedUsers = @{} # Dictionary to track processed users
|
||||
|
||||
}
|
||||
|
||||
process {
|
||||
if ($founde3Sku.Count -ne 0) {
|
||||
$allUsers = Get-MgUser -Filter "assignedLicenses/any(x:x/skuId eq $($founde3Sku.SkuId) )" -All
|
||||
if ($null -ne $allUsers) {
|
||||
$mailboxes = Get-EXOMailbox -PropertySets Audit
|
||||
try {
|
||||
foreach ($user in $allUsers) {
|
||||
|
||||
Reference in New Issue
Block a user