Microsoft.Xrm.Data.PowerShell icon indicating copy to clipboard operation
Microsoft.Xrm.Data.PowerShell copied to clipboard

Approve-CRMEmailAddress fails

Open fuentej opened this issue 9 years ago • 2 comments

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 <systemuserid last="{5C9C652C-C414-E711-811C-E0071B6AC171}" first="{5C9C652C-C414-E711-811C-E0071B6AC171}"... NextPage False FetchXml ...

fuentej avatar Aug 22 '17 14:08 fuentej

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.

fuentej avatar Aug 22 '17 15:08 fuentej

Thanks for the update! This issue is currently closed, thanks!

seanmcne avatar Aug 23 '17 01:08 seanmcne