-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2g.ps1: ignore but preserve case evaluating mailbox addresses
References: GXH-71
- Loading branch information
Showing
1 changed file
with
11 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,13 +117,15 @@ $LinuxUser = "root" | |
# The $LinuxUser password - or use certificate based authentication | ||
$LinuxUserPWD = "Secret_root_Password" | ||
|
||
# Import only these mailboxes, an array of mail addresses, $IgnoreMboxes will be honored | ||
# To import all mailboxes leave empty, to import only some mailboxes, populate $ImportMboxes | ||
#[string] $ImportMboxes = '[email protected]','[email protected]' | ||
# Import only these mailboxes, an array of mail addresses, case insensitive, | ||
# $IgnoreMboxes will be honored. | ||
# To import all mailboxes leave empty, to import only some mailboxes, populate | ||
# $ImportMboxes. | ||
#[string] $ImportMboxes = '[email protected]','[email protected]' | ||
[string] $ImportMboxes = '' | ||
|
||
# Ignore these mailboxes, an array of mail addresses | ||
[string] $IgnoreMboxes = 'testx1@example.com','testx2@example.com' | ||
# Ignore these mailboxes, an array of mail addresses, case insensitive | ||
[string] $IgnoreMboxes = 'TestX1@example.com','Testx2@example.com' | ||
|
||
# Delete .pst files after import to save space. | ||
$DeletePST = $true | ||
|
@@ -420,22 +422,22 @@ foreach ($Mailbox in (Get-Mailbox)) { | |
|
||
if ($ImportMboxes.length -gt 5) { | ||
# Use $ImportMboxes only if it contains a minimum of one mail address | ||
if ($ImportMboxes.contains($MigMBox)) { | ||
if ($ImportMboxes.ToLower().contains($MigMBox.ToLower())) { | ||
Write-MLog "Mailbox: $MigMBox found in `$ImportMboxes list." green | ||
} else { | ||
$MailboxesSkipped++ | ||
$MailboxesTotal++ | ||
Write-MLog "Ignoring mailbox: $MigMBox, mailbox not in `$ImportMboxes list." yellow | ||
continue | ||
} # if ($ImportMboxes.contains($MigMBox)) | ||
} | ||
} # if ($ImportMboxes.length -gt 5) | ||
|
||
if ($IgnoreMboxes.contains($MigMBox)) { | ||
if ($IgnoreMboxes.ToLower().contains($MigMBox.ToLower())) { | ||
$MailboxesSkipped++ | ||
$MailboxesTotal++ | ||
Write-MLog "Ignoring mailbox: $MigMBox, found mailbox in `$IgnoreMboxes list." yellow | ||
continue | ||
} # if ($IgnoreMboxes.contains($MigMBox)) | ||
} | ||
Write-MLog "" white | ||
# Clean up before exporting a mailbox | ||
# Remove all MailboxExportRequest, to make check for "Completed" more robust | ||
|