Skip to content

Commit

Permalink
Bug fix for checking email-only under AD checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjantzen committed Jun 28, 2024
1 parent c2c5aae commit 7bf34ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions User Audit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Created Date: Tuesday, August 2nd 2022, 10:36:05 am
# Author: Chris Jantzen
# -----
# Last Modified: Fri Jun 14 2024
# Last Modified: Fri Jun 28 2024
# Modified By: Chris Jantzen
# -----
# Copyright (c) 2023 Sea to Sky Network Solutions
Expand Down Expand Up @@ -2807,7 +2807,7 @@ if ($FullMatches) {
# Even if it is false, the script still considers someone EmailOnly if they solely have an O365 account
$EmailOnly = $false
$EmailOnlyDetails = ""
if ($EmailOnlyHaveAD -and $HasEmail -and $EmailEnabled -and $O365Match.o365.RecipientTypeDetails -like 'UserMailbox' -and $ADMatch.PSObject.Properties.Name -contains "Groups" -and $LoginUserType -notin ('Local', 'AzureAD')) {
if ($EmailOnlyHaveAD -and $HasEmail -and $EmailEnabled -and $O365Match -and $O365Match.o365.RecipientTypeDetails -like 'UserMailbox' -and $ADMatch.PSObject.Properties.Name -contains "Groups" -and $LoginUserType -notin ('Local', 'AzureAD')) {
$EmployeeGroups = @()
foreach ($Group in $ADMatch.Groups) {
if (($EmailOnlyGroupsIgnore | ForEach-Object{$Group -like $_}) -notcontains $true ) {
Expand Down Expand Up @@ -2874,7 +2874,7 @@ if ($FullMatches) {
}
}
}
} elseif ($O365Match.o365.RecipientTypeDetails -notlike 'UserMailbox') {
} elseif ($O365Match -and $O365Match.o365.RecipientTypeDetails -notlike 'UserMailbox') {
$EmailOnlyDetails = "Mailbox is not a UserMailbox"
}

Expand Down
6 changes: 3 additions & 3 deletions User_Billing_Update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Created Date: Tuesday, August 2nd 2022, 10:36:05 am
# Author: Chris Jantzen
# -----
# Last Modified: Fri Jun 14 2024
# Last Modified: Fri Jun 28 2024
# Modified By: Chris Jantzen
# -----
# Copyright (c) 2023 Sea to Sky Network Solutions
Expand Down Expand Up @@ -1354,7 +1354,7 @@ if ($UserAudit) {
# Even if it is false, the script still considers someone EmailOnly if they solely have an O365 account
$EmailOnly = $false
$EmailOnlyDetails = ""
if ($EmailOnlyHaveAD -and $HasEmail -and $EmailEnabled -and $O365Match.o365.RecipientTypeDetails -like 'UserMailbox' -and $ADMatch.PSObject.Properties.Name -contains "Groups" -and $LoginUserType -notin ('Local', 'AzureAD')) {
if ($EmailOnlyHaveAD -and $HasEmail -and $EmailEnabled -and $O365Match -and $O365Match.o365.RecipientTypeDetails -like 'UserMailbox' -and $ADMatch.PSObject.Properties.Name -contains "Groups" -and $LoginUserType -notin ('Local', 'AzureAD')) {
$EmployeeGroups = @()
foreach ($Group in $ADMatch.Groups) {
if (($EmailOnlyGroupsIgnore | ForEach-Object{$Group -like $_}) -notcontains $true ) {
Expand Down Expand Up @@ -1421,7 +1421,7 @@ if ($UserAudit) {
}
}
}
} elseif ($O365Match.o365.RecipientTypeDetails -notlike 'UserMailbox') {
} elseif ($O365Match -and $O365Match.o365.RecipientTypeDetails -notlike 'UserMailbox') {
$EmailOnlyDetails = "Mailbox is not a UserMailbox"
}

Expand Down
2 changes: 1 addition & 1 deletion currentversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.19.4
2.19.5

0 comments on commit 7bf34ae

Please sign in to comment.