Exemple #1
0
        public System.DirectoryServices.Protocols.ResultCode AddUserToAdamGroup(Entities.User user, AdamConnetion.AdamServer adamServer, string group)
        {
            try
            {
                AdamHelper adamHelper = new AdamHelper(adamServer.ServerIP, adamServer.ServerPort, adamServer.UsersDistinguishedName, adamServer.GetCredential());

                return adamHelper.AddUserToGroup(user.UserNameWithoutMembership, group);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
 public void DeleteUserAdam(string profile, AdamConnetion.AdamServer adamServer)
 {
     try
     {
         AdamHelper adamHelper = new AdamHelper(adamServer.ServerIP, adamServer.ServerPort, adamServer.UsersDistinguishedName, adamServer.GetCredential());
         if (adamHelper.UserExist(profile))
         {
             adamHelper.DeleteUser(profile);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #3
0
        public bool UserExistAdam(AdamConnetion.AdamServer adamServer, Entities.User user)
        {
            try
            {
                AdamHelper adamHelper = new AdamHelper(adamServer.ServerIP, adamServer.ServerPort, adamServer.UsersDistinguishedName, adamServer.GetCredential());

                return adamHelper.UserExist(user.UserNameWithoutMembership);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        public System.DirectoryServices.Protocols.ResultCode CreateUserAdam(Entities.User user, AdamConnetion.AdamServer adamServer)
        {
            try
            {
                AdamHelper adamHelper = new AdamHelper(adamServer.ServerIP, adamServer.ServerPort, adamServer.UsersDistinguishedName, adamServer.GetCredential());

                return adamHelper.CreateUser(user.UserNameWithoutMembership, user.FullName, user.Password);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }