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
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156