From 429240f403fdcb7d0741ced4e322ccb24441b194 Mon Sep 17 00:00:00 2001 From: "Jeremy D. Berkleef" Date: Thu, 4 Nov 2021 09:58:20 +0100 Subject: [PATCH] Add mass mailbox locale changing functionality --- Docs/exchange-toolkit.md | 5 ++++- exchange-toolkit.ps1 | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Docs/exchange-toolkit.md b/Docs/exchange-toolkit.md index fa0c742..eff62c8 100644 --- a/Docs/exchange-toolkit.md +++ b/Docs/exchange-toolkit.md @@ -39,4 +39,7 @@ ### 5. Export a series of mailboxes to .pst This has only been tested against On-Prem Exchange. - This option will export the mailboxes found via the search term to a .pst. For some reason, Exchange requires a UNC path for the export. \ No newline at end of file + This option will export the mailboxes found via the search term to a .pst. For some reason, Exchange requires a UNC path for the export. + + ### 6. Set mailbox locale based on a search term + This allows you to change a large number of mailboxes' language, time zone and date format settings in one go. \ No newline at end of file diff --git a/exchange-toolkit.ps1 b/exchange-toolkit.ps1 index 2453f6e..9e12f39 100644 --- a/exchange-toolkit.ps1 +++ b/exchange-toolkit.ps1 @@ -25,6 +25,10 @@ Write-Host -ForegroundColor Cyan " '5' " -NoNewline Write-Host "to export a list of mailboxes to .pst based on a search term." + Write-Host "6: Press" -NoNewline + Write-Host -ForegroundColor Cyan " '6' " -NoNewline + Write-Host "to change mailbox locale/language based on a search term." + Write-Host "Q: Press" -NoNewline Write-Host -ForegroundColor Red " 'Q' " -NoNewline Write-Host "to quit." @@ -126,6 +130,17 @@ do New-MailboxExportRequest -Mailbox $mailbox -FilePath "$exportPath.pst" } } + + '6' { + $searchTerm = Read-Host -Prompt "Input Query" + $targetLanguage = Read-Host -Prompt "Language to switch to (nl-NL for Dutch)" + $targetTimezone = Read-Host -Prompt "Time zone to switch to ("W. Europe Standard Time" for GMT -1)" + $targetDateFormat = Read-Host -Prompt "Date format to switch to (e.g. "d-M-yyy")" + + #Search mailboxes and apply the changes + Get-Mailbox | Where-Object {$_.EmailAddresses -like "$searchTerm"} | Set-MailboxRegionalConfiguration -Language "$targetLanguage" -TimeZone "$targetTimezone" -DateFormat "$targetDateFormat" + } + } Read-Host -Prompt 'Press Enter to Continue' }