static internal Principal DirectoryEntryAsPrincipal(DirectoryEntry de, StoreCtx storeCtx) { string className = de.SchemaClassName; // Unlike AD, we don't have to worry about cross-store refs here. In AD, if there's // a cross-store ref, we'll get back a DirectoryEntry of the FPO object. In the WinNT ADSI // provider, we'll get back the DirectoryEntry of the remote object itself --- ADSI does // the domain vs. local resolution for us. if (SAMUtils.IsOfObjectClass(de, "Computer") || SAMUtils.IsOfObjectClass(de, "User") || SAMUtils.IsOfObjectClass(de, "Group")) { return(storeCtx.GetAsPrincipal(de, null)); } else { Debug.Fail(String.Format( CultureInfo.CurrentCulture, "SAMUtils.DirectoryEntryAsPrincipal: fell off end, Path={0}, SchemaClassName={1}", de.Path, de.SchemaClassName)); return(null); } }
internal static Principal DirectoryEntryAsPrincipal(DirectoryEntry de, StoreCtx storeCtx) { if (SAMUtils.IsOfObjectClass(de, "Computer") || SAMUtils.IsOfObjectClass(de, "User") || SAMUtils.IsOfObjectClass(de, "Group")) { return storeCtx.GetAsPrincipal(de, null); } else { return null; } }
internal static Principal DirectoryEntryAsPrincipal(DirectoryEntry de, StoreCtx storeCtx) { if (SAMUtils.IsOfObjectClass(de, "Computer") || SAMUtils.IsOfObjectClass(de, "User") || SAMUtils.IsOfObjectClass(de, "Group")) { return(storeCtx.GetAsPrincipal(de, null)); } else { return(null); } }