Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ package/docs/PraRemoteMailbox-Guide.md -text whitespace=blank-at-eol,space-befor
package/docs/PraRemoteMailbox-UserGuide.html -text whitespace=blank-at-eol,space-before-tab,blank-at-eof,cr-at-eol
package/docs/PraRemoteMailbox-UserGuide.md -text whitespace=blank-at-eol,space-before-tab,blank-at-eof,cr-at-eol
package/docs/images/console-next-cloud-light.png -text
package/docs/images/console-next-finalize-light.png -text
package/docs/images/console-next-global-light.png -text
package/docs/images/console-next-light.png -text
package/docs/images/console-next-package-light.png -text
package/docs/images/console-next-rollback-light.png -text
package/docs/images/console-run-cloud-light.png -text
package/docs/images/console-run-early-light.png -text
package/docs/images/console-run-finalize-light.png -text
package/docs/images/console-run-finished-dark.png -text
package/docs/images/console-run-finished-light.png -text
package/docs/images/console-run-grant-light.png -text
Expand All @@ -62,6 +64,7 @@ package/docs/images/console-task-scope-light.png -text
package/docs/images/console-verify-before-light.png -text
package/docs/images/console-verify-check-light.png -text
package/docs/images/console-verify-cloud-light.png -text
package/docs/images/console-verify-finalize-light.png -text
package/docs/images/console-verify-light.png -text
package/docs/images/console-verify-rollback-light.png -text
package/docs/images/console-verify-scope-light.png -text
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ All notable changes of PRA Remote Mailbox. Author: Nicolas Fabert. Versions foll
a MAJOR version changes the command line or the configuration file, a MINOR version adds a feature,
a PATCH version fixes a defect. The backup formats have their own version (see the guide, annex D).

## 3.1.0 — 2026-11-06

### Added
- **X500 control at Convert.** The AD phase now also reads `legacyExchangeDN` (read only, never written or restored) and
records in the batch the X500 addresses the cloud mailbox must carry: `X500:<legacyExchangeDN>` plus the X500 addresses
already in the on-premises `proxyAddresses`. Once the mailbox is ready, the cloud phase proves them in Exchange Online
(the Entra `proxyAddresses` when the mailbox check goes through Graph), re-reads a few times for a synchronisation lag,
and warns per mailbox when one is missing: replies to old messages and meeting updates could bounce (IMCEAEX NDR).
The conversion stays done.
- The preview shows *X500 to verify after the conversion: N*; `-Action Check` and the console's *Check a mailbox* show
the same comparison, read only. The warning is counted in the result, the reports and the Next steps.

### Changed
- A batch written before 3.1.0 has no expected list: the control is skipped with an information line, never a failure.
The backup schema is unchanged (one more optional field per record).
- Phase detection tests the network: *AD + Cloud* is proposed only if Microsoft 365 answers from this server (HTTPS to the
sign-in and Exchange Online endpoints, in the background); otherwise *AD*, with a new Setup light that says why.
- User guide clarified: which path is yours, what the cloud server is (a company machine, not a server in the cloud), where the
phase shows on screen, the Complete a rollback screens, working links.

## 3.0.0 — 2026-11-05

**Breaking: PowerShell 7.5+ required.** Windows PowerShell 5.1 is refused before any code runs; use 2.x there.
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In a hybrid organisation, a mailbox hosted on-premises is only a *mail user* for

Done by hand, this means rewriting about ten Exchange attributes per object in Active Directory, for hundreds of objects, under stress — and keeping every original value to come back later: a wrong or lost value cannot be repaired without a backup. This tool does the conversion in a planned, verified and **reversible** way.

**Author:** Nicolas Fabert · **Version:** 3.0.0, 2026-11-05 ([changelog](CHANGELOG.md)).
**Author:** Nicolas Fabert · **Version:** 3.1.0, 2026-11-06 ([changelog](CHANGELOG.md)).

> [!CAUTION]
> Convert creates **new, empty** mailboxes in Exchange Online: the content of the on-premises mailboxes is not moved. A Recover deprovisions the cloud mailboxes: export first what was received in the cloud during the disaster, or protect it with a retention policy (reference guide, chapter 6).
Expand Down Expand Up @@ -69,7 +69,7 @@ Install-Module Microsoft.Graph.Authentication, Microsoft.Graph.Users -Scope AllU
# 3 · Fill in the settings: scope, licence group, routing domain, Entra Connect server, tenant
notepad D:\PRA\PraRemoteMailbox\config\PraRemoteMailbox.config.psd1

# 4 · Open the console: five lights on the first page, all green or grey
# 4 · Open the console: the lights on the first page, all green or grey
pwsh -STA -File D:\PRA\PraRemoteMailbox\Invoke-PraRemoteMailbox.ps1 -Gui
```

Expand All @@ -78,7 +78,7 @@ pwsh -STA -File D:\PRA\PraRemoteMailbox\Invoke-PraRemoteMailbox.ps1 -Gui
<br>
<picture>
<source media="(prefers-color-scheme: dark)" srcset="package/docs/images/console-setup-dark.png">
<img alt="The Setup page of the console: the environment, what this server can run, and five prerequisite lights, all green" src="package/docs/images/console-setup-light.png">
<img alt="The Setup page of the console: the environment, what this server can run, and the prerequisite lights, all green" src="package/docs/images/console-setup-light.png">
</picture>
</details>

Expand All @@ -93,7 +93,7 @@ cd D:\PRA\PraRemoteMailbox
# 6 · Move everyone: the scope of the settings file, on one server
.\Invoke-PraRemoteMailbox.ps1 -Action Convert # preview
.\Invoke-PraRemoteMailbox.ps1 -Action Convert -Mode Apply # backup, AD, sync, Exchange Online
# Two servers (the AD server cannot reach the cloud): on the AD server, then copy ONE zip file to the cloud server
# Two servers (no single server reaches both Active Directory and Microsoft 365): on the AD server, then copy ONE zip file to the cloud server
.\Invoke-PraRemoteMailbox.ps1 -Action Convert -Phase AD -Mode Apply
.\Invoke-PraRemoteMailbox.ps1 -Action Convert -Phase Cloud -Batch 'PRA-PROD-Convert-490cc62e-for-Cloud.zip' -Mode Apply # on the cloud server

Expand Down Expand Up @@ -145,8 +145,9 @@ Keep the `Backups` folder on a durable, protected volume: the backups are the on
- **Signed package.** The runtime lives in `package\` (same layout as the extracted release ZIP). Every runtime file authenticates the owner-signed manifest before it runs; a changed, missing or unexpected stable file stops the tool before any import or operation. The configuration and your CSV lists are data, outside that check. There is no unsigned mode. The tool refuses to run from any tree whose files are not signed by the owner: use a signed release package. Backup, log and report folders inside the package are limited to the canonical `Backups`, `logs` and `reports`. See [package/README.md](package/README.md).
- **One script, one configuration file.** The scope is one object (`-Identity`), an OU, the members of an AD group or a CSV list — users only, shared mailboxes only, or both.
- **Preview by default.** Without `-Mode Apply` the tool only reads. With `-Mode Apply` it shows the plan and asks **one** confirmation (`-Force` for unattended runs).
- **X500 control.** The batch records the X500 addresses (`legacyExchangeDN` and older X500) that the cloud mailbox must carry; the cloud phase proves them and warns if one is missing, because replies to old messages would otherwise bounce.
- **One batch ID** links the steps: every Apply prints it with the exact next command, and `-Action Recover -Batch <id>` rolls the batch back.
- **One or two servers**: everything from one server, or the AD part on-premises and the cloud part on an isolated server.
- **One or two servers**: everything from one server that reaches both Active Directory and Microsoft 365, or the AD part on the AD server and the cloud part on a **cloud server**. The cloud server is not a server hosted in the cloud: it is any Windows machine of your organisation that reaches Microsoft 365 through the Internet, with no access to Active Directory.

<picture>
<source media="(prefers-color-scheme: dark)" srcset="package/docs/images/readme-principles-dark.png">
Expand Down Expand Up @@ -194,7 +195,7 @@ Exchange on-premises is down, so the tool reads the permissions where Exchange k

Open the console with `pwsh -STA -File .\package\Invoke-PraRemoteMailbox.ps1 -Gui` (native Fluent theme, PowerShell 7.5+, English). It starts no operation by itself; every operation runs the existing engine in a separate **PowerShell 7.5+** process (the same `pwsh.exe`).

The console is a guided path of five pages: **Setup** (the environment, what this server can run, the prerequisite lights from real detection, one line of run settings), **Task** (move mailboxes, roll back, complete a rollback, check a mailbox, on what: one identity to test first, the configured scope, an OU or a CSV, or a batch or package to continue), **Verify** (the Preview in plain words, then the confirmation word in any letter case), **Run** (the steps announced by the engine, with their waits and warnings in plain words; click a step or an object) and **Next steps**. Run settings changed in the window apply to that run only, through a guarded effective copy of the configuration: the file is never rewritten. See the [reference guide](package/docs/PraRemoteMailbox-Guide.md), chapter 8.
The console is a guided path of five pages: **Setup** (the environment, what this server can run, the prerequisite lights from real detection, one line of run settings), **Task** (move mailboxes, roll back, complete a rollback, check a mailbox, on what: one identity to test first, the configured scope, an OU or a CSV, or a batch or package to continue), **Verify** (the Preview in plain words, then the confirmation word in any letter case), **Run** (the steps announced by the engine, with their waits and warnings in plain words; click a step or an object) and **Next steps**. Run settings changed in the window apply to that run only, through a guarded effective copy of the configuration: the file is never rewritten. See the [reference guide, chapter 8](package/docs/PraRemoteMailbox-Guide.md#8-everyday-use).

<picture>
<source media="(prefers-color-scheme: dark)" srcset="package/docs/images/console-run-finished-dark.png">
Expand Down
58 changes: 33 additions & 25 deletions package/Invoke-PraRemoteMailbox.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@

.NOTES
Author : Nicolas Fabert
Version : 3.0.0
Version : 3.1.0
Requires : PowerShell 7.5 or later (pwsh.exe; Windows PowerShell 5.1 is refused), RSAT ActiveDirectory,
ExchangeOnlineManagement 3.10+, Microsoft.Graph.Authentication and Microsoft.Graph.Users
(cloud part), ADSync (sync; through the Windows PowerShell compatibility layer when local).
Expand Down Expand Up @@ -925,11 +925,12 @@ try {
$stepTitle = switch ($Action) { 'Check' { 'Objects to check' } 'Recover' { 'Loading the Recover batch' } default { 'Loading the batch of the AD phase' } }
Write-PraStep -Context $context -Title $stepTitle -Icon Batch
if ((Test-PraOrdinalIgnoreCaseEqual $Action 'Check') -and $Identity -and -not $Batch) {
if ($Identity -match '@') { $record = [pscustomobject]@{ ObjectGuid = ''; SamAccountName = $Identity; UserPrincipalName = $Identity; IsShared = ((Test-PraOrdinalIgnoreCaseEqual $Scope 'SharedOnly')) } }
if ($Identity -match '@') { $record = [pscustomobject]@{ ObjectGuid = ''; SamAccountName = $Identity; UserPrincipalName = $Identity; IsShared = ((Test-PraOrdinalIgnoreCaseEqual $Scope 'SharedOnly')); ExpectedX500Note = 'identity given as a UPN, no Active Directory read: give the sAMAccountName or -Batch' } }
else {
Initialize-PraDirectory $context
$user = Get-PraUser $context $Identity
$record = [pscustomobject]@{ ObjectGuid = ([guid]$user.ObjectGUID).ToString(); SamAccountName = $user.SamAccountName; UserPrincipalName = $user.UserPrincipalName; IsShared = ((Test-PraOrdinalIn $user.msExchRecipientTypeDetails @(4, 34359738368) -IgnoreCase)) }
$record = [pscustomobject]@{ ObjectGuid = ([guid]$user.ObjectGUID).ToString(); SamAccountName = $user.SamAccountName; UserPrincipalName = $user.UserPrincipalName; IsShared = ((Test-PraOrdinalIn $user.msExchRecipientTypeDetails @(4, 34359738368) -IgnoreCase))
ExpectedX500 = [string[]]@(Get-PraExpectedX500 -LegacyExchangeDN ([string](Get-PraValue $user 'legacyExchangeDN' '')) -ProxyAddresses @($user.proxyAddresses)) }
}
$context.Rows.Add((New-PraRow $context $record))
Write-PraItem -Context $context -Status Ok -Text ("{0} ({1})" -f $record.UserPrincipalName, $(if ($record.IsShared) { 'shared mailbox' } else { 'user mailbox' }))
Expand Down Expand Up @@ -1057,6 +1058,13 @@ try {
if ($context.AllowMutation -and (Test-PraOrdinalIgnoreCaseEqual $Action 'Convert') -and (Test-PraOrdinalIn $effectivePhase @('Both','Cloud') -IgnoreCase) -and $context.BatchId -and -not $context.Issues.Count) {
$context.NextSteps = @($(if ((Test-PraOrdinalIgnoreCaseEqual $effectivePhase 'Cloud')) { 'To roll back this batch later, on the AD server: ' + (Get-PraCommandLine -ActionName 'Recover' -ModeName 'Preview' -BatchId $context.BatchId -OtherServer) } else { 'To roll back this batch later: ' + (Get-PraCommandLine -ActionName 'Recover' -ModeName 'Preview' -BatchId $context.BatchId) }))
}

# X500 addresses missing in Exchange Online (warning of the cloud phase): synchronise, then check again.
$x500Missing = @(Get-PraList $context 'X500Missing')
if ($x500Missing.Count) {
$checkCommand = Get-PraCommandLine -ActionName 'Check' -ModeName 'Preview' -BatchId $context.BatchId -KeepFilters
$context.NextSteps = @(@(Get-PraList $context 'NextSteps') + ('X500 missing in Exchange Online for {0} object(s) (replies to old messages can bounce): run an Entra Connect synchronisation, then check again: {1}' -f $x500Missing.Count, $checkCommand))
}
}
catch {
$failure = $_; $failureOperation = $context.CurrentOperation
Expand Down Expand Up @@ -1094,8 +1102,8 @@ finally {
# SIG # Begin signature block
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