seanmcne / Microsoft.Xrm.Data.PowerShell

This module uses the CRM connection from Microsoft.Xrm.Tooling.CrmConnector.Powershell and provides common functions to create, delete, query, and update data as well as functions for common tasks such as publishing, and manipulating System & CRM User Settings, etc. The module should function for both Dynamics CRM Online and On-Premise environment.
201 stars 64 forks source link

Mail Activation doesn't work with global admin #504

Closed jdefr42x closed 1 year ago

jdefr42x commented 2 years ago

Hi !

I have a problem with the approval of mailboxes. No error message, but variable isemailaddressapprovedbyo365admin does not change. No problem with same account from GUI. (note : our dynamics is in french)

$User = Get-CrmRecords -EntityLogicalName systemuser -FilterAttribute domainname -FilterOperator "eq" -FilterValue $emailAddress -Fields * -WarningAction Continue -ErrorAction Stop
$UserId = $User.systemuserid
Approve-CrmEmailAddress -UserId $UserId
or
Set-CrmUserMailbox -UserId $UserId -StateCode Actif -StatusCode Actif -ScheduleTest -ApproveEmail
seanmcne commented 1 year ago

@jdefr42 sorry for the delay your issue slipped by an I didn't notice, I'm not aware of any issue with this though, I'm a little limited in terms of what I can easily test, in the past as long as the user was an exchange admin or global admin this would function and I know there was a previous issue logged where we had someone trying to get it working with a service principal instead that you could look for in the issue history.

Mailbox approval has always had some quirks and has changed, as you can imagine there is a lot of careful consideration our engineering team takes into account with regard to mailbox/email address approval as it could have consequences if people without the right permissions were able to approve an email address. I would expect the API calls to behave the same for the UI (which is typically the situation) though it's possible there was a change in the API. If you did wind up figuring it out or opened a support case to figure it out please let me know. Thanks!

jdefr42x commented 1 year ago

Thank you for your comeback

seanmcne commented 1 year ago

@jdefr42 I just noticed it looks like the documentation was updated (a couple months back) for changes which are being made to the process - what I noticed just now was the flag saying there are changes rolling out so we might want to keep an eye on this article to see how it evolves.

https://learn.microsoft.com/en-us/power-platform/admin/connect-exchange-online#approve-email

image

seanmcne commented 1 year ago

Looks like the docs were updated with the version #'s https://learn.microsoft.com/en-us/power-platform/admin/connect-exchange-online#delegate-mailbox-approval