Trying to find to domain

Dec 10, 2013 at 4:50 AM
Hi everyone,

I'm trying to figure out how to get the domain name of a user. I tried using userPrincipalName (or something like that) but I don't think that's the best method.

Mar 10, 2014 at 10:50 AM
Hi, Samuel.

I'm not quite sure what you mean by the "domain name" of a user. The domain name is a property of the Active Directory server, not of the user. Do you mean the user name? In which case, userPrincipalName is probably what you want. Here's a list of User object attributes, although you might find Microsoft's documentation more useful, especially the User class page and the User Object attributes page and more specifically, the User naming attributes page.

I hope that's useful.