4.1.4.2.17 LookupUPNAndAltSecID

 procedure LookupUPNAndAltSecID(
   flags: DWORD,
   IncludingAltSecID: boolean,
   name: unicodestring): set of DSName

Informative summary of behavior: Returns DSNames of objects, with the given value as a value of userPrincipalName, altSecurityIdentities, or sAMAccountName.

 rt, rt1, rt2: set of DSName
  
 /* Try lookup by userPrincipalName and altSecurityIdentities
  * or by only userPrincipalName depending on what is
  * requested */
 if IncludingAltSecID then
   rt1 := LookupAttr(flags, userPrincipalName, name)
   rt2 := LookupAttr(flags, altSecurityIdentities, name)
   rt := rt1 + rt2
 else
   rt := LookupAttr(flags, userPrincipalName, name)
 endif
  
 if rt ≠ null then
   return rt
 endif
  
 /* Finally, attempt to parse the name as simpleName@domain and
  * search for
  * sAMAccountName=simpleName. */
 name := UserNameFromUPN(name)
 if name ≠ null then
   rt := LookupAttr(flags, sAMAccountName, name)
 endif
  
 return rt
  
Show: