Ejemplo n.º 1
0
        public static IEnumerable<KeyValuePair<string, string>> GetGroupListByAdOrg(AdOrg org)
        {
            var list = new Dictionary<string, string>();

            using (WindowsImpersonationContextFacade impersonationContext
                = new WindowsImpersonationContextFacade(
                    nc))
            {
                var domain = new PrincipalContext(ContextType.Domain, "UN1T.GROUP", String.Format("{0}, DC=UN1T,DC=GROUP", AdOrganization.GetAdPathByAdOrg(org)));
                GroupPrincipal groupList = new GroupPrincipal(domain, "*");
                PrincipalSearcher ps = new PrincipalSearcher(groupList);

                foreach (var grp in ps.FindAll())
                {
                    list.Add(grp.Sid.Value, grp.Name);
                }
            }

            return list;
        }
Ejemplo n.º 2
0
 public static string GetAdPathByAdOrg(AdOrg org)
 {
     return GetList().Single(g => g.Org == org).AdPath;
 }
Ejemplo n.º 3
0
 public IEnumerable<KeyValuePair<string, string>> GetGroupListByAdOrg(AdOrg org)
 {
     return AdHelper.GetGroupListByAdOrg(org);
 }
Ejemplo n.º 4
0
 public AdOrganization(AdOrg org, string path, string name)
 {
     Org = org;
     AdPath = path;
     Name = name;
 }