3.1.1.3.1 GetDirectoryForAccount

GetDirectoryForAccount is an abstract interface that returns the Directory containing a specified account. The interface takes one parameter named account of type DomainAccount and returns a Directory. If Active Directory is used, the directory is found by invoking the LsarLookupNames4 method specified in [MS-LSAT] section 3.1.4.5 on the primary domain controller with the following parameters:

Count: Set to 1.

Names: Set to the name field of account.

LookupLevel: Set to LsapLookupWksta.

LookupOptions: Set to 0.

ClientRevision: Set to 2.

When LsarLookupNames4 returns, the ReferencedDomains parameter will contain the name of the directory containing the account. If the return value of LsarLookupNames4 is not STATUS_SUCCESS, GetDirectoryForAccount returns NULL.