Let's break down the questions regarding connecting your on-premises Dynamics CRM 2016 to Exchange Online using the provided PowerShell scripts.
Question 1: 365 Hybrid Connector - Installation
The Microsoft 365 Hybrid Configuration Wizard (HCW) is the tool used to configure a hybrid deployment between your on-premises Exchange organization and Exchange Online.
- Installation Location: The Hybrid Configuration Wizard is run from a server within your on-premises Exchange environment. It doesn't get installed as a persistent service. You download and run it when you need to configure or modify your hybrid setup.
- Purpose: The HCW helps establish trust, configure mail flow, manage free/busy sharing, and handle other aspects of a hybrid Exchange environment. While it's primarily for Exchange hybrid, the trust established can be leveraged for other Microsoft 365 integrations.
- Relevance to CRM: While the HCW itself doesn't directly configure the CRM-to-Exchange Online connection, ensuring a properly functioning Exchange Hybrid environment is a prerequisite for server-side synchronization to work reliably. The trust and authentication mechanisms established by the HCW are often necessary for Dynamics 365 to communicate securely with Exchange Online.
In summary, the Microsoft 365 Hybrid Configuration Wizard is downloaded and run on an on-premises Exchange server to configure the hybrid environment. It's a one-time (or as-needed) tool, not a continuously running service.
Question 2: Using the ConfigureCrmServerSideSync.ps1
Script
Yes, the script block you've quoted from step 4 of the instructions is intended to be used to configure the server-side synchronization between your on-premises Dynamics CRM 2016 and Exchange Online.
How to Use the Script:
You need to replace the placeholder parameters within the $ConfigureCrmServerSideSyncWithCommand
variable with your actual values. Let's break down each parameter:
-privateKeyPassword 'personal_certfile_password'
: Replace 'personal_certfile_password'
with the actual password you used to protect the private key of the certificate (.pfx
file).
-pfxFilePath c:\Personalcertfile.pfx
: Replace c:\Personalcertfile.pfx
with the full path to the .pfx
certificate file on the server where you are running the PowerShell script.
-organizationName organization_name
: Replace organization_name
with the unique name of your Dynamics CRM 2016 organization. This is the name you see when you access your CRM instance in a browser (e.g., contoso
).
-microsoftEntraIdTenantIdOrDomainName microsoft_entraid_tenantid_or_domain_name
: Replace microsoft_entraid_tenantid_or_domain_name
with either your Microsoft Entra ID (Azure AD) Tenant ID (a GUID) or your primary domain name associated with your Microsoft 365 subscription (e.g., contoso.onmicrosoft.com
or contoso.com
).
-ClientID app_id_from_step3
: Replace app_id_from_step3
with the Application (client) ID of the Azure AD application registration you created in the previous step of the Microsoft documentation. This application represents your on-premises CRM instance in Azure AD.
-ClientSecret -client_secret
: Replace -client_secret
with the client secret you generated for the Azure AD application registration. Ensure there is a space between -ClientSecret
and the actual secret.
Do you use the entire script?
The script block you've quoted from step 4 is designed to be executed after you have downloaded the ConfigureCrmServerSideSync.ps1
script to your local machine.
Here's the intended workflow:
- Download
ConfigureCrmServerSideSync.ps1
: Obtain the script from the link provided in the Microsoft documentation.
- Navigate to the Script Directory: Open a PowerShell window and navigate to the directory where you saved the
ConfigureCrmServerSideSync.ps1
file.
- Construct the Command: Modify the
$ConfigureCrmServerSideSyncWithCommand
variable in your PowerShell session by replacing all the placeholder parameters with your specific values, as described above.
- Execute the Command: Run the command
Invoke-Expression -command $ConfigureCrmServerSideSyncWithCommand
. This will execute the ConfigureCrmServerSideSync.ps1
script with the parameters you provided.
Regarding the "STEP 2 SCRIPT" ($CertificateScriptWithCommand
):
The documentation provides this $CertificateScriptWithCommand
in Step 2 to configure the certificate within your on-premises CRM. You will likely need to run this script before you run the ConfigureCrmServerSideSync.ps1
script in Step 4.
For the "STEP 2 SCRIPT", you also need to replace the parameters:
-certificateFile c:\Personalcertfile.pfx
: Replace with the full path to your .pfx
certificate file.
-password personal_certfile_password
: Replace with the password for your certificate's private key.
-updateCrm
: This flag indicates that you want to update CRM with the certificate information.
-certificateType S2STokenIssuer
: This specifies that the certificate will be used for Server-to-Server (S2S) authentication.
-serviceAccount contoso\CRMAsyncService
: Replace contoso\CRMAsyncService
with the domain and user name of the service account under which your Dynamics CRM Asynchronous Processing Service is running.
-storeFindType FindBySubjectDistinguishedName
: This specifies how to find the certificate in the local certificate store.
Therefore, the general process will be:
- Run the
$CertificateScriptWithCommand
(after replacing parameters) to configure the certificate in CRM.
- Run the
$ConfigureCrmServerSideSyncWithCommand
(after replacing parameters) to configure the connection to Exchange Online.
Important Considerations:
- Permissions: Ensure the user account running these PowerShell scripts has the necessary administrative privileges on the CRM server and within your Microsoft 365 environment.
- Certificate: You will need a valid SSL certificate that can be used for S2S authentication. The documentation likely outlines the requirements for this certificate.
- Firewall Rules: Ensure that the necessary firewall rules are in place to allow communication between your on-premises CRM server and Exchange Online.
- Testing: After running the scripts, thoroughly test the server-side synchronization functionality by sending and receiving emails, tracking appointments, and using other integrated features.
By carefully following the steps in the Microsoft documentation and replacing the parameters in both the Step 2 and Step 4 scripts with your specific environment details, you should be able to establish the server-side synchronization between your on-premises Dynamics CRM 2016 and Exchange Online. Remember to perform these steps in a non-production environment first if possible.