示例#1
0
 // EnableMailbox()
 // desc: Method calls PowerShellComponent command EnableMailbox, enables user mailbox on Exchange Server
 // params: string upn      - User Principal Name
 //         string thealias - User login name
 // method: public
 // return: string, XML string of ExchangeUser object
 public static string EnableMailbox(string upn, string thealias)
 {
     string Results;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     Results                                          = objManage.EnableMailbox(upn, thealias);
     objManage                                        = null;
     return Results;
 }
示例#2
0
 // ChangePassword()
 // desc: Method calls PowerShellComponent command ChangePassword, changes user password with password given
 // params: Dictionary<string, string> attributes - Dictionary object, contains attributes to change user password
 // method: public
 // return: bool
 public static bool ChangePassword(string identity, string password)
 {
     bool Results;
     PowerShellComponent.ManagementCommands objManange = new PowerShellComponent.ManagementCommands();
     Results                                           = objManange.ChangePassword(identity, password);
     objManange                                        = null;
     return Results;
 }
 // GetDistributionGroup()
 // desc: Method calls PowerShellComponent command GetDistributionGroup, returns list of DistributionGroup/DistributionGroups
 // params: string identity  - Distribution group name, passed in by ExchSvc
 //         int current_page - Page to return
 //         int per_page     - Number of entries to return per page
 // method: public
 // return: string, XML string of DistributionGroup object
 public static string GetDistributionGroup(string identity, int current_page, int per_page, string ou)
 {
     string result;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     result = objManage.GetDistributionGroup(identity, current_page, per_page, ou);
     objManage = null;
     return result;
 }
 // CreateMailContact()
 // desc: Method calls PowerShellComponent command CreateMailContact and creates a new mail contact under given OU
 // params: string name  - Name of mail contact
 //         string email - Email of mail contact
 //         string ou    - Organizational Unit to create mail contact
 // method: public
 // return: bool
 public static bool CreateMailContact(string name, string email, string ou)
 {
     bool Results;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     Results = objManage.CreateMailContact(name, email, ou);
     objManage = null;
     return Results;
 }
 // CreateDistributionList()
 // desc: Method calls PowershellComponent command CreateDistributionList and creates a new distribution group under specified OU
 // params: string group_name - Name of Distribution Group to create
 //         string ou         - Name of Organizational Unit to create Organizational Group in
 // method: public
 // return: bool
 public static string CreateDistributionGroup(string group_name, string ou, string auth_enabled)
 {
     string Results;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     Results = objManage.CreateDistributionGroup(group_name, ou, auth_enabled);
     objManage = null;
     return Results;
 }
 // AddToDistributionGroup()
 // desc: Method calls PowershellComponent command AddToDistributionGroup and adds a user to a distribution group
 // params: string group_name - Name of Distribution Group to add user to
 //         string alias      - Name of user to add to group
 // method: public
 // return: bool
 public static bool AddToDistributionGroup(string group_name, string alias)
 {
     bool Results;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     Results = objManage.AddToDistributionGroup(group_name, alias);
     objManage = null;
     return Results;
 }
示例#7
0
 // AddGroupMember()
 // desc: Method calls PowerShellComponent command AddGroupMember, adds user to group
 // params: Dictionary<string, string> attributes - Dictionary object, contains attributes for user
 // method: public
 // return: string, XML string of ExchangeUser object
 public static string AddGroupMember(Dictionary<string, string> attributes)
 {
     PowerShellComponent.ManagementCommands objManage = null;
     string Results = null;
     try
     {
         objManage = new PowerShellComponent.ManagementCommands();
         Results = objManage.AddGroupMember(attributes);
     }
     catch (Exception e)
     {
         return e.Message;
     }
     objManage = null;
     return Results;
 }
示例#8
0
 // GetUser()
 // desc: Method calls PowerShellComponent command GetUser, returns list of user/users
 // params: string thealias  - User login name, passed in by ExchSvc
 //         int current_page - Page to return
 //         int per_page     - Number of entries to return per page
 // method: public
 // return: string, XML string of ExchangeUser object
 public static string GetUser(string thealias, int current_page, int per_page, bool vpn_only, string ou)
 {
     string result;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     result                                           = objManage.GetUser(thealias, current_page, per_page, vpn_only, ou);
     objManage                                        = null;
     return result;
 }
示例#9
0
 public static ExchangeUser GetMailContact(ExchangeUser user)
 {
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     return XmlSerializationHelper.Deserialize<ExchangeUser>(objManage.GetSerializedMailContact(XmlSerializationHelper.Serialize(user)));
 }
示例#10
0
 public static void DeleteMailContact(string alias)
 {
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     objManage.DeleteMailContact(alias);
 }
示例#11
0
 internal static bool RemoveADUser(string identity)
 {
     bool Results;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     Results = objManage.DeleteADUser(identity);
     objManage = null;
     return Results;
 }
示例#12
0
 // RemoveMailBox()
 // desc: Method calls PowerShellComponent command DeleteUser, deletes user from Exchange and AD Server
 // params: string identity - User login name
 // method: public
 // return: bool
 public static bool RemoveMailbox(string identity)
 {
     bool Results;
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     Results                                          = objManage.DeleteUser(identity);
     objManage                                        = null;
     return Results;
 }
 public static DistributionGroup UpdateDistributionGroup(DistributionGroup group)
 {
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     string updatedGroupXml = objManage.UpdateDistributionGroup(XmlSerializationHelper.Serialize(group));
     return XmlSerializationHelper.Deserialize<DistributionGroup>(updatedGroupXml);
 }
 public static void DeleteDistributionGroup(DistributionGroup group)
 {
     PowerShellComponent.ManagementCommands objManage = new PowerShellComponent.ManagementCommands();
     objManage.DeleteDistributionGroup(XmlSerializationHelper.Serialize(group));
 }