Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

weird service retrieve error

(0) ShareShare
ReportReport
Posted on by

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

  • Robinson Moses Profile Picture
    on at
    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
dkrishna Profile Picture

dkrishna 6

Featured topics

Product updates

Dynamics 365 release plans