You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Correcting script to evaluate license check properly, include org relationships with expanded mailboxMoveCapabilities and added support for large group memberships over 1000 members
Copy file name to clipboardexpand all lines: Admin/CrossTenantMailboxMigrationValidation.ps1
+14-15
Original file line number
Diff line number
Diff line change
@@ -193,8 +193,8 @@ function CheckObjects {
193
193
#Check for the T2T license on any of the objects (either source or target) as long as the source mailbox is a regular mailbox
194
194
Write-Verbose-Message "Informational: Source mailbox is regular, checking if either SOURCE mailbox or TARGET MailUser has the T2T license assigned"
195
195
if ($SourceObject.RecipientTypeDetails-eq'UserMailbox') {
196
-
if ($SourceObject.PersistedCapabilities-notmatch'ExchangeT2TMbxMove') {
197
-
if ($TargetObject.PersistedCapabilities-notmatch'ExchangeT2TMbxMove') {
196
+
if ($SourceObject.PersistedCapabilities-notcontains'ExchangeT2TMbxMove') {
197
+
if ($TargetObject.PersistedCapabilities-notcontains'ExchangeT2TMbxMove') {
198
198
Write-Host">> Error: Neither SOURCE mailbox or TARGET MailUser have a valid T2T migration license. This is a pre-requisite, and if the license is not assigned by the time the migration is injected, it will fail to complete"-ForegroundColor Red
199
199
} else {
200
200
Write-Verbose-Message "TARGET MailUser has a valid T2T migration license"
@@ -273,8 +273,8 @@ function CheckObjects {
273
273
274
274
#Verify if SOURCE mailbox is part of the Mail-Enabled Security Group defined on the SOURCE organization relationship
275
275
Write-Verbose-Message "Informational: Checking if the SOURCE mailbox is a member of the SOURCE organization relationship Mail-Enabled Security Group defined on the MailboxMovePublishedScopes"
if ((Get-SourceDistributionGroupMember$SourceTenantOrgRelationship.MailboxMovePublishedScopes[0]-ResultSize unlimited).Name -contains$SourceObject.Name) {
278
278
Write-Host">> SOURCE mailbox is within the MailboxMovePublishedScopes"-ForegroundColor Green
279
279
} else {
280
280
Write-Host">> Error: SOURCE mailbox is NOT within the MailboxMovePublishedScopes. The migration will fail if you don't correct this"-ForegroundColor Red
@@ -416,7 +416,7 @@ function CheckObjects {
416
416
Write-Verbose-Message "Informational: The X500 address $($Address) from SOURCE object is present on TARGET object"
417
417
} else {
418
418
if (!$TargetObject.IsDirSynced) {
419
-
Write-Host">> Error: $($Address) is not present on the TARGET MailUser, would you like to add it? (Y/N): "-ForegroundColor Red-NoNewline
419
+
Write-Host">> Warning: $($Address) is not present on the TARGET MailUser. All of the X500 addresses of the source mailbox object, as a best practice, should be present on the target MailUser object. Would you like to add it? (Y/N): "-ForegroundColor Yellow-NoNewline
420
420
$AddX500=Read-Host
421
421
Write-Host" Your input: $($AddX500)"
422
422
if ($AddX500.ToLower() -eq"y") {
@@ -426,7 +426,7 @@ function CheckObjects {
426
426
$TargetObject=Get-TargetMailUser$TargetIdentity
427
427
}
428
428
} else {
429
-
Write-Host">> Error: $($Address) is not present on the TARGET MailUser and the object is DirSynced. This is not a change that can be done directly on EXO, please add the X500 address from on-premises and perform an AADConnect delta sync"-ForegroundColor Red
429
+
Write-Host">> Warning: $($Address) is not present on the TARGET MailUser and the object is DirSynced. All of the X500 addresses of the source mailbox object, as a best practice, should be present on the target MailUser object. This is not a change that can be done directly on EXO, please add the X500 address from on-premises and perform an AADConnect delta sync"-ForegroundColor Yellow
430
430
}
431
431
}
432
432
}
@@ -489,8 +489,8 @@ function CheckObjectsSourceOffline {
489
489
#Check for the T2T license on any of the objects (either source or target) as long as the source mailbox is a regular mailbox
490
490
Write-Verbose-Message "Informational: Source mailbox is regular, checking if either SOURCE mailbox or TARGET MailUser has the T2T license assigned"
491
491
if ($SourceObject.RecipientTypeDetails-eq'UserMailbox') {
492
-
if ($SourceObject.PersistedCapabilities-notmatch'ExchangeT2TMbxMove') {
493
-
if ($TargetObject.PersistedCapabilities-notmatch'ExchangeT2TMbxMove') {
492
+
if ($SourceObject.PersistedCapabilities-notcontains'ExchangeT2TMbxMove') {
493
+
if ($TargetObject.PersistedCapabilities-notcontains'ExchangeT2TMbxMove') {
494
494
Write-Host">> Error: Neither SOURCE mailbox or TARGET MailUser have a valid T2T migration license. This is a pre-requisite, and if the license is not assigned by the time the migration is injected, it will fail to complete"-ForegroundColor Red
495
495
} else {
496
496
Write-Verbose-Message "TARGET MailUser has a valid T2T migration license"
@@ -559,7 +559,7 @@ function CheckObjectsSourceOffline {
559
559
#Verify if SOURCE mailbox is part of the Mail-Enabled Security Group defined on the SOURCE organization relationship
560
560
Write-Verbose-Message "Informational: Checking if the SOURCE mailbox is a member of the SOURCE organization relationship Mail-Enabled Security Group defined on the MailboxMovePublishedScopes"
if ($SourceTenantMailboxMovePublishedScopesSGMembers.Name-contains$SourceObject.Name) {
565
565
Write-Host">> SOURCE mailbox is within the MailboxMovePublishedScopes"-ForegroundColor Green
@@ -704,7 +704,7 @@ function CheckObjectsSourceOffline {
704
704
Write-Verbose-Message "Informational: The X500 address $($Address) from SOURCE object is present on TARGET object"
705
705
} else {
706
706
if (!$TargetObject.IsDirSynced) {
707
-
Write-Host">> Error: $($Address) is not present on the TARGET MailUser, would you like to add it? (Y/N): "-ForegroundColor Red -NoNewline
707
+
Write-Host">> Error: $($Address) is not present on the TARGET MailUser. All of the X500 addresses of the source mailbox object, as a best practice, should be present on the target MailUser object. Would you like to add it? (Y/N): "-ForegroundColor Red -NoNewline
708
708
$AddX500=Read-Host
709
709
Write-Host" Your input: $($AddX500)"
710
710
if ($AddX500.ToLower() -eq"y") {
@@ -714,7 +714,7 @@ function CheckObjectsSourceOffline {
714
714
$TargetObject=Get-TargetMailUser$TargetIdentity
715
715
}
716
716
} else {
717
-
Write-Host">> Error: $($Address) is not present on the TARGET MailUser and the object is DirSynced. This is not a change that can be done directly on EXO, please add the X500 address from on-premises and perform an AADConnect delta sync"-ForegroundColor Red
717
+
Write-Host">> Error: $($Address) is not present on the TARGET MailUser and the object is DirSynced. All of the X500 addresses of the source mailbox object, as a best practice, should be present on the target MailUser object. This is not a change that can be done directly on EXO, please add the X500 address from on-premises and perform an AADConnect delta sync"-ForegroundColor Red
if (($_.MailboxMoveEnabled) -and ($_.MailboxMoveCapability-eq"RemoteOutbound") -and ($_.MailboxMovePublishedScopes)) {
1114
1114
Write-Host"Informational: $($_.Identity) organization relationship meets the conditions for a cross tenant mailbox migration scenario, exporting members of the security group defined on the MailboxMovePublishedScopes"-ForegroundColor Yellow
0 commit comments