0
votes

I need to configure email settings for a number of CRM online instances. I want to automate this as some of the sandbox environments will be reset periodically.

I have one instance configured manually (with our on prem exchange) so know what need to be done to get it working but I can't for the life of me seem to be able to retrieve and update the email server profile configuration. I either want to amend the default profile or create a new one.

I'm using the Microsoft.Xrm.Data.Powershell module so i'm able to retrieve entities and records but can't seem to find the specific data i'm after.

Has anybody done this before or able to point me in the right direction?

1

1 Answers

0
votes

While I have never done this myself here are some ideas that might help:

The EmailServerProfile entity supports the typical CRUD messages, as well as specialized messages like GrantAccess, ModifyAccess, and RevokeAccess.

Options to run these from PowerShell would include:

  1. Use PowerShell to make requests to the D365 WebAPI, which will require OAuth2

  2. Install the Microsoft SDK Nuget Package(s) into PowerShell, load the appropriate assemblies, then create the .NET objects and run their methods. This post has more info on this type of approach.

  3. This package says it allows you to "invoke any available CRM request", so that might be worth looking into.

I checked this package, which has a lot of commands, including Approve-CrmEmailAddress and Revoke-CrmEmailAddress but did not see anything pertaining to EmailServerProfile.