Skip to content

Commit

Permalink
Added and option to ignore duplicate contact warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjantzen committed Oct 26, 2023
1 parent 761bd27 commit bba3eb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion User_Billing_Update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# HISTORY:
# Date By Comments
# ---------- --- ----------------------------------------------------------
# 2023-10-26 CJ Added and option to ignore duplicate contact warnings: # Ignore Duplicate Warnings
# 2023-07-21 CJ Modified customer billing page update to remove any old per-device billing info.
# 2023-03-20 CJ Fixed bug where we weren't sending O365 unmatched info, and changed to send emails if there are unmatched accounts (AD or O365).
###
Expand Down Expand Up @@ -1609,11 +1610,21 @@ if ($UserAudit) {
$DuplicateContacts = Compare-Object -ReferenceObject $UniqueContacts -DifferenceObject $FullContactList.attributes."name"
}
$DuplicateIDs = @()
$DuplicateITGContacts = @()

foreach ($Contact in $DuplicateContacts.InputObject) {
$DuplicateIDs += ($FullContactList | Where-Object { $_.attributes.name -like $Contact }).id
$DuplicateITGContacts += ($FullContactList | Where-Object { $_.attributes.name -like $Contact })
}

$RemoveIgnoredDuplicates = @()
foreach ($Contact in $DuplicateITGContacts) {
if ($Contact.attributes.notes -like "*# Ignore Duplicate Warnings*") {
$RemoveIgnoredDuplicates += $Contact.attributes.name
}
}
$DuplicateITGContacts = $DuplicateITGContacts | Where-Object { $_.attributes.name -notin $RemoveIgnoredDuplicates }
$DuplicateIDs = $DuplicateITGContacts.id

# Create some html for an email based on the $WarnContacts
$DueDate = $(get-date).AddDays(5).ToString("dddd, MMMM d")
$HTMLBody = ""
Expand Down
2 changes: 1 addition & 1 deletion currentversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.18.3
2.18.4

0 comments on commit bba3eb3

Please sign in to comment.