Approve-CRMEmailAddress fails
Trying to approve a user that shows as enabled, but getting an error that it is disabled, but the systemUserID does not match.
When I look up the UserID that it says is disabled, it resolves to a service account for non-production instances, but this is the production instance, and it is disabled on purpose. But I am not sure "why" it matters that this account is disabled.
PS C:\PS1\CRM\CRMAccessController\Actions\testing> $CRMuser = (Get-CrmRecords -EntityLogicalName systemuser -FilterAttribute domainname -FilterOperator "eq" -FilterValue [email protected] -Fields * -WarningAction Continue -ErrorAction Stop).CrmRecords PS C:\PS1\CRM\CRMAccessController\Actions\testing> PS C:\PS1\CRM\CRMAccessController\Actions\testing> $CRMuser.fullname Justin Weiss PS C:\PS1\CRM\CRMAccessController\Actions\testing> $CRMuser.isemailaddressapprovedbyo365admin No PS C:\PS1\CRM\CRMAccessController\Actions\testing> Approve-CrmEmailAddress -UserId $CRMUser.systemUserId -WarningAction Continue -ErrorActio n Continue The user with SystemUserId=e1a74ced-c314-e711-811c-e0071b6ac171 in OrganizationContext=98b34967-7ec5-4b19-bdc5-a31d62bf647b is disabled At C:\Program Files\WindowsPowerShell\Modules\Microsoft.Xrm.Data.Powershell\2.5\Microsoft.Xrm.Data.Powershell.psm1:758 char:9
-
throw $conn.LastCrmException -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : OperationStopped: (:) [], FaultException`1
- FullyQualifiedErrorId : The user with SystemUserId=e1a74ced-c314-e711-811c-e0071b6ac171 in OrganizationContext=98b34967-7ec5-4b19-bd c5-a31d62bf647b is disabled
PS C:\PS1\CRM\CRMAccessController\Actions\testing> $CRMuser.systemuserID
Guid
5c9c652c-c414-e711-811c-e0071b6ac171
PS C:\PS1\CRM\CRMAccessController\Actions\testing> $CRMuser = Get-CrmRecords -EntityLogicalName systemuser -FilterAttribute domainname -FilterOperator "eq" -FilterValue [email protected] -Fields * -WarningAction Continue -ErrorAction Stop PS C:\PS1\CRM\CRMAccessController\Actions\testing> $CRMuser
Key Value
CrmRecords {@{address2_addresstypecode_Property=[address2_addresstypecode, Microsoft.Xrm.Sdk.OptionSetValue]; address2_addresstypecode...
Count 1
PagingCookie
Nevermind, I have found that the manual step in the UI is not working either. This is just a symptom.
Please close, or let me know what I need to do to close it.
Thanks for the update! This issue is currently closed, thanks!