//Получение контроллеров из ActiveDirectory
 private static List<UserBase> GetControllers()
 {
     var db = new DbEngine();
     var roles = db.LoadRoles();
     var list = new List<UserBase>();
     var domain = new PrincipalContext(ContextType.Domain);
     var group = GroupPrincipal.FindByIdentity(domain, IdentityType.Name, roles.First(x=>x.Role == Role.Controller).Name);
     if (group != null)
     {
         var members = group.GetMembers(true);
         foreach (var principal in members)
         {
             var userPrincipal = UserPrincipal.FindByIdentity(domain, principal.Name);
             if (userPrincipal != null)
             {
                 var email = userPrincipal.EmailAddress;
                 var name = userPrincipal.DisplayName;
                 var sid = userPrincipal.Sid.Value;
                 var shortName = GetShortName(name);
                 var user = new UserBase()
                 {
                     Id = sid,
                     Name = name,
                     ShortName = shortName,
                     Email = email
                 };
                 list.Add(user);
             }
         }
     }
     return list;
 }
 static UserHelper()
 {
     var db = new DbEngine();
     _roles = db.LoadRoles();
 }