Final Step: Removing relationship between Exchange server and EXO

May 29, 2018 | by iaur | posted as Hybrid(EXO), M365 Migration

This steps only applies to organization who completed the move for all on-premise mailboxes to Microsoft 365 (EXO) and for organization is deciding to decommission their Exchange server.

Undo HCW and DirSync

Connect to On-Prem Exchange Management Shell (EMS):

Get-organizationrelatioship | select name
Remove-OrganizationRelationship -identity “name_of_org_relationship”
[PG J izationReIationshiD 
— i de ity 
"On—premises CO 0365 — 
c2439a19-6a7d-4ba3 
onFirm 
re you supe you want to perform this action? 
enouing organization relationship "On—premises 
[Y] Yes [A] Yes to All [N] No [L] No to All 
to 0365 
Help 
c2439ai 9-6a7d-4ba3-a2Ea-eØ3ei8bad92e 
(default is a
Remove-FederatedDomain -domainname name_of_domain
C: —domainnane ' 
cps J 
irm 
ire you sure you want to perform this action? 
aceresionen-xyz 
Removing Federated domain "faceresionem.xyz on organization • 'Facere Sionen••. 
Yes [A] Yes to All [N] No No to Help (default is
Remove-FederationTrust -Identity “Microsoft Federation Gateway”
] Yes to 
Help (default 
[PSI C: —Identity "Micro; Et Federation Gateway" 
30nFirm 
you supe you want to perform this action? 
Removing Federation Trust "Microsoft Federation 
[Y] Yes [A] Yes to 911 [N) No No to 911 
Gateway". 
[ ? ] Help (default
C: NCPPSceipts ederat ion trust 
C: ipt s t —re no te do main 
Do ma in N ane 
eFauIt 
faceresione . 
ybrid Domain — 
ybrid Domain 
— 'facepesione. 
faceresionem nail . on microsoft 
'facepesionem.onnicrosoFt.com 
com 
Extern a I 
External 
Exte r n al
Remove-SendConnector “Connector_Name”
EPS J C: 
den t it;y 
n tern et 
utbound co Office 365 
Address$pacesv 
{smtp:faceresionem nail. onnicrosof . 
Enabled 
True 
. T rue 
EPS) C: "Outbound to Off-ice 3650 
onFirm 
re you supe you want to 
enouing Send connector 
[Y] Yes [A] Yes to All 
perform this action? 
"Outbound to OFF ice 365". 
C? HelD (default 
[N] No No to All
Remove-HybridConfiguration
Machine generated alternative text:
[PSI 
20 n f 
you sure you want to perform this action? 
darning: Removing the HybridConFiguration Rctiue Directory object Will not disable OF uninstall the underlining hybrid 
Features that have been conf igured in your hybrid deployment. IF you want to completely renoue your hybrid 
see http:ZZgo.nicrosoFt.com/fwIinkZ?LinkId=259795 
Help (default is a 
Yes Yes to All [N] No [L] No to 911

Connect to Office 365 Exchange Online PowerShell:

Get-organizationrelatioship | select name
Remove-OrganizationRelationship -identity “name of_org_relationship”

Access On-Prem Exchange Control Panel (ECP):

  • Remove the Email Address Policy/Policies associated with SMTP domains that have been moved to Office 365.
  • Remove the Accepted Domain entries from the on-premises Exchange admin console for SMTP domains that have been moved to Office 365
C A Not secure 
Test Lao 0 0365 - Admin cen€ Skype(PSTN) 
Concierge Program 
Enterprise Office 365 
Exchange admin center 
bemi: 
0365 
- Exchange : 
0365 - SharePoint 
Casual Browsing 
To Read 
Technical 
Technical Writing 
GeekSqu. 
Steps Recorder - Recording Now 
@Pause Record Stop Record Add Comment • 
receive connectors send connectors 
recipients 
permissions 
compiiance management 
organization 
protection 
mail flow 
mobile 
public folders 
unified messaging 
servers 
hybrid 
rules delivery reports 
NAME 
accepted domains 
facetesionem.local (default domain) 
faceresion em ft.com 
ACCEPTED DO 
faceresionern.l 
face resionem, 
facer esio nem 
email address policies 
Warning 
Are you sure you want to delete the accepted domain 
"faceresionem.mail.onmicrosoft.com-? 
Yes 
faceresionem.mail.onmicrasoft.com 
Fully qualified domain name: 
faceresionem.mail.onmicrosoft.com 
Domain type: 
Authoritative 
No

Access Office 365 Exchange Admin Center (EAC):

  • Remove Outbound Connector to on-premise
  • Remove Inbound Connector from on-premise
Machine generated alternative text:
xchange admin center 
ishöaard 
cipients 
irm•sslans 
mpliance management 
genization 
ctectian 
ivanced threats 
ail flow 
obile 
•blic folders 
lified messaging 
'brid 
rules 
message trace 
url trace 
accepted domains 
remote domains 
connectors 
Connectors help control the flow of email messages to and from your Office 365 organization. However, because most organizations don't need to use connectors, we recommend that you first check to see if you should create a connector. 
Want to help us improve connectors? Just send us feedback and let us know what you liked, didn't like, or what we can do to make your experience better. 
STATUS 
NAME 
Inbound from 7306d62-c488-46ea-8250-c66c378514ab 
Outbound to 73f06d62-c488-46e8-8250-c66c378514ab 
FROM 
Your organization's a-nail server 
Office 365 
Office 365 
Inbound from 73f06d62-c488-46e8-8250-c66c378514ab 
Your organization's email server 
Mail tow scenario 
From: Your organization's email server 
To: Office 365 
Description 
None 
Status 
Turn it off 
How to identify email sent from your email server 
Identify incoming messages from your email server by verifying that the subject name on the connecting TLS certificate 
matches this domain: *.faceresionem.xyz, and the sender's email address is an accepted domain for your organization.

Connect to MSOL : (OPTIONAL)

Turn – Off DirSync

 Set-MsolDirSyncEnabled -EnableDirSync $false
Remove-MsolDomain -DomainName “faceresionem.mail.onmicrosoft.com” -Force

Pre requisites:

PS C:\> Get-MsolUser -all | ?{$_.userprinciplename -match “domain.com”}

PS C:\> Get-MsolUser -all | ?{$_.emailaddress -match “domain.com”}

PS C:\> Get-MsolUser -all | ?{$_.proxyaddresses -match “domain.com”}

PS C:\> Get-MsolGroup -all | ?{$_.proxyaddresses -match “domain.com”}

PS C:\> Get-MsolGroup -all | ?{$_.proxyaddresses -match “domain.com”} | Remove-MsolGroup -force

PS C:\> Get-MsolGroup -all | ?{$_.emailaddress -match “domain.com”} | Remove-MsolGroup -force

PS C:\> Remove-MsolDomain -DomainName domain.com -force

PS C:\> Get-MsolDomain

$Records = Get-mailbox -ResultSize Unlimited| where {$_.emailaddresses -like “smtp:*@domain.com”} | Select-Object DisplayName,@{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_ -like “smtp:*domain.com”}}}

foreach ($record in $Records)

{

    write-host “Removing Alias” $record.EmailAddresses “for” $record.DisplayName

    Set-Mailbox $record.DisplayName -EmailAddresses @{Remove=$record.EmailAddresses}

}

https://help.bittitan.com/hc/en-us/articles/115008260408-How-do-I-remove-a-domain-from-Office-365-

Feedback or Help?

Should you have one, click here

Boring Ads. Pardon me :)