private static void ValidateRole(ActiveDirectoryRole adRole)
 {
     if (adRole.GetEntries().Count == 0)
     {
         throw new ArgumentException(SR.GetString("Error_NoMatchingActiveDirectoryEntry"));
     }
 }
 private static void ValidateRole(ActiveDirectoryRole adRole)
 {
     if (adRole.GetEntries().Count == 0)
     {
         throw new ArgumentException(SR.GetString("Error_NoMatchingActiveDirectoryEntry"));
     }
 }
Exemplo n.º 3
0
        public static ActiveDirectoryRole CreateFromEmailAddress(String emailAddress)
        {
            if (emailAddress == null)
                throw new ArgumentNullException("emailAddress");

            ActiveDirectoryRole role = new ActiveDirectoryRole(GetRootEntry(), new DirectoryRootQuery("mail", emailAddress, DirectoryQueryOperation.Equal));
            role.Operations.Add(s_directoryGroupQuery);
            ValidateRole(role);
            return role;
        }
Exemplo n.º 4
0
        public static ActiveDirectoryRole CreateFromSecurityIdentifier(SecurityIdentifier sid)
        {
            if (sid == null)
                throw new ArgumentNullException("sid");

            ActiveDirectoryRole role = new ActiveDirectoryRole(GetRootEntry(), new DirectoryRootQuery("objectSID", sid.ToString(), DirectoryQueryOperation.Equal));
            role.Operations.Add(s_directoryGroupQuery);
            ValidateRole(role);
            return role;
        }
Exemplo n.º 5
0
        public static ActiveDirectoryRole CreateFromAlias(String alias)
        {
            if (alias == null)
                throw new ArgumentNullException("alias");

            ActiveDirectoryRole role = new ActiveDirectoryRole(GetRootEntry(), new DirectoryRootQuery("sAMAccountName", alias, DirectoryQueryOperation.Equal));
            role.Operations.Add(s_directoryGroupQuery);
            ValidateRole(role);
            return role;
        }
        public static ActiveDirectoryRole CreateFromSecurityIdentifier(SecurityIdentifier sid)
        {
            if (sid == null)
            {
                throw new ArgumentNullException("sid");
            }
            ActiveDirectoryRole adRole = new ActiveDirectoryRole(GetRootEntry(), new DirectoryRootQuery("objectSID", sid.ToString(), DirectoryQueryOperation.Equal));

            adRole.Operations.Add(s_directoryGroupQuery);
            ValidateRole(adRole);
            return(adRole);
        }
        public static ActiveDirectoryRole CreateFromEmailAddress(string emailAddress)
        {
            if (emailAddress == null)
            {
                throw new ArgumentNullException("emailAddress");
            }
            ActiveDirectoryRole adRole = new ActiveDirectoryRole(GetRootEntry(), new DirectoryRootQuery("mail", emailAddress, DirectoryQueryOperation.Equal));

            adRole.Operations.Add(s_directoryGroupQuery);
            ValidateRole(adRole);
            return(adRole);
        }
        public static ActiveDirectoryRole CreateFromAlias(string alias)
        {
            if (alias == null)
            {
                throw new ArgumentNullException("alias");
            }
            ActiveDirectoryRole adRole = new ActiveDirectoryRole(GetRootEntry(), new DirectoryRootQuery("sAMAccountName", alias, DirectoryQueryOperation.Equal));

            adRole.Operations.Add(s_directoryGroupQuery);
            ValidateRole(adRole);
            return(adRole);
        }