add: New process for collecting MgGraph output to make pester testing easier
This commit is contained in:
@@ -27,9 +27,6 @@ function Test-MailboxAuditingE5 {
|
||||
# - Condition C: AuditDelegate actions do not include all of the following: ApplyRecord, Create, HardDelete, MailItemsAccessed, MoveToDeletedItems, SendAs, SendOnBehalf, SoftDelete, Update, UpdateFolderPermissions, UpdateInboxRules.
|
||||
# - Condition D: AuditOwner actions do not include all of the following: ApplyRecord, HardDelete, MailItemsAccessed, MoveToDeletedItems, Send, SoftDelete, Update, UpdateCalendarDelegation, UpdateFolderPermissions, UpdateInboxRules.
|
||||
|
||||
$e5SkuPartNumber = "SPE_E5"
|
||||
$founde5Sku = Get-MgSubscribedSku -All | Where-Object { $_.SkuPartNumber -eq $e5SkuPartNumber }
|
||||
|
||||
$actionDictionaries = Get-Action -Dictionaries
|
||||
$AdminActions = $actionDictionaries.AdminActions.Keys
|
||||
$DelegateActions = $actionDictionaries.DelegateActions.Keys
|
||||
@@ -38,11 +35,11 @@ function Test-MailboxAuditingE5 {
|
||||
$allFailures = @()
|
||||
$processedUsers = @{}
|
||||
$recnum = "6.1.3"
|
||||
$allUsers = Get-MgOutput -Rec $recnum
|
||||
}
|
||||
|
||||
process {
|
||||
if (($founde5Sku.count) -ne 0) {
|
||||
$allUsers = Get-MgUser -Filter "assignedLicenses/any(x:x/skuId eq $($founde5Sku.SkuId) )" -All
|
||||
if ($null -ne $allUsers) {
|
||||
$mailboxes = Get-EXOMailbox -PropertySets Audit
|
||||
try {
|
||||
foreach ($user in $allUsers) {
|
||||
|
||||
Reference in New Issue
Block a user