The distinguishedName
property of any AD object should always contain the full LDAP compatible path to that object, e.g.
CN=John Doe,OU=Marketing,OU=IntlSales,DC=YourMegaCorp,DC=com
Based on that DN you can figure out the domain (DC=YourMegaCorp,DC=com
) that this user came from. I don't think there's any other (default) AD attribute that would give you just the domain, though - you'll need to "crack and parse" that DN to get the info you need.