Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

weird service retrieve error

Posted on by Microsoft Employee

Hello - I'm using the following query to get the domainname for a user guid:

var domainName =
context.OrganizationService.Retrieve(
SystemUser.EntityLogicalName, userGuid, new ColumnSet(new string[] { "DomainName" }))
.ToEntity<SystemUser>().DomainName;

However, this query is returning the following error:

Exception: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: 'SystemUser' entity doesn't contain attribute with Name = 'DomainName'.

SystemUser does have a DomainName field, I even double checked the spelling. So do you have any idea why the query above might be throwing the exception above?

*This post is locked for comments

  • RE: weird service retrieve error

    Hello Andrew,

    Thank you for posting the question in this forum.

    I did some research and found the following, Go to ADSI Edit in the DC machine, Open the Users >>> Open the user in question, right click on the user and go to properties and look for Object GUID, Copy to a NotePad, Now go to the SQL machine, and Open the SSMS, run the following query against the Org_MSCRM DB :- select * from systemuserbase, look for the Domain user that you were looking for, and you can compare the Object GUID of the AD to the ActiveDirectory GUID that was retrieved from the SQL query.

    I hope this is what you are looking for, If not please let me know.

    Thanks & Regards,

    Rob Moses

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans