Skip to content

Instantly share code, notes, and snippets.

@alirobe
Last active March 8, 2016 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alirobe/a175761f956521f2fdbe to your computer and use it in GitHub Desktop.
Save alirobe/a175761f956521f2fdbe to your computer and use it in GitHub Desktop.
Enable CRM 2013 SP1 - Exchange 2013 Synchronisation
# run on exchange machine
add-pssnapin Microsoft.Exchange.Management.PowerShell.SnapIn
$serviceAccountName = "CrmEmailServiceAcct"
$serviceAccountUser = Get-User -Identity $serviceAccountName
Get-ExchangeServer | where {$_.IsClientAccessServer -eq $TRUE} | ForEach-Object {
Add-ADPermission -Identity $_.distinguishedname -User $serviceAccountUser.identity -AccessRights ExtendedRight -ExtendedRight ms-Exch-EPI-Impersonation
Add-ADPermission -Identity $_.distinguishedname -User $serviceAccountUser.identity -AccessRights ExtendedRight -ExtendedRight ms-Exch-EPI-May-Impersonate
}
Get-MailboxDatabase | ForEach-Object {Add-ADPermission -Identity $_.DistinguishedName -User $serviceAccountName -ExtendedRights ms-Exch-EPI-May-Impersonate}
New-ManagementRoleAssignment –Name:impersonationAssignmentForCrm –Role:ApplicationImpersonation –User:$serviceAccountName
# in CRM settings -> email -> (new server profile) : set "credentials specified in email server profile."
# set user/pass in there, with impersonation enabled.
# then: add a mailbox to profile, clear its alerts, run enable, and check alerts.
# note : also ensure https://owa.xyz/EWS/Exchange.asmx are incoming and outgoing, and certs works for both CRM and Exchnage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment