0
UserPrincipal.FindByIdentity有兩個重載。其中一個沒有指定一個IdentityType(但另一個)。UserPrincipal.FindByIdentity使用哪種默認IdentityType類型?
下面哪個默認的IdentityType實際使用?
UserPrincipal.FindByIdentity有兩個重載。其中一個沒有指定一個IdentityType(但另一個)。UserPrincipal.FindByIdentity使用哪種默認IdentityType類型?
下面哪個默認的IdentityType實際使用?
我相信它會搜索所有的身份類型。當然這意味着它可以找到多個匹配,在這種情況下引發一個MultipleMatchesException
。
ETA:確認它確實搜索了所有這些文件。挖掘到code,在605線附近:
// This is the tricky case. They didn't specify a UrnScheme, so we need to
// try all of them.
string[] urnSchemesToTry = new string[]
{
UrnScheme.SamAccountScheme,
UrnScheme.UpnScheme,
UrnScheme.DistinguishedNameScheme,
UrnScheme.SidScheme,
UrnScheme.GuidScheme,
UrnScheme.NameScheme
};