protected override void InternalProcessRecord() { try { NewDistributionGroupCmdlet newDistributionGroupCmdlet = new NewDistributionGroupCmdlet(); ADObjectId executingUserId; base.ExchangeRunspaceConfig.TryGetExecutingUserId(out executingUserId); newDistributionGroupCmdlet.Authenticator = Authenticator.Create(base.CurrentOrganizationId, executingUserId); newDistributionGroupCmdlet.HostServerName = EOPRecipient.GetPsWsHostServerName(); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.Name, this.Name); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.DisplayName, this.DisplayName); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.Alias, this.Alias); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.PrimarySmtpAddress, this.PrimarySmtpAddress); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.Notes, this.Notes); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.ManagedByForInput, this.ManagedBy); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.Members, this.Members); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.Type, this.Type.ToString()); EOPRecipient.SetProperty(newDistributionGroupCmdlet, Parameters.Organization, base.Organization); newDistributionGroupCmdlet.Run(); EOPRecipient.CheckForError(this, newDistributionGroupCmdlet); } catch (Exception e) { base.ThrowAndLogTaskError(e); } }
public static void NewFFOGroup(DataRow inputRow, DataTable table, DataObjectStore store) { NewDistributionGroupCmdlet newDistributionGroupCmdlet = new NewDistributionGroupCmdlet(); newDistributionGroupCmdlet.Authenticator = PswsAuthenticator.Create(); newDistributionGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null); newDistributionGroupCmdlet.Name = inputRow["Name"].ToString(); newDistributionGroupCmdlet.DisplayName = inputRow["Name"].ToString(); newDistributionGroupCmdlet.Alias = inputRow["Alias"].ToString(); newDistributionGroupCmdlet.PrimarySmtpAddress = inputRow["PrimarySmtpAddress"].ToString(); newDistributionGroupCmdlet.Notes = inputRow["Notes"].ToString(); string[] managedBy = (from o in (object[])inputRow["ManagedBy"] select((Identity)o).DisplayName).ToArray <string>(); newDistributionGroupCmdlet.ManagedBy = managedBy; string[] members = (from o in (object[])inputRow["Members"] select((Identity)o).DisplayName).ToArray <string>(); newDistributionGroupCmdlet.Members = members; newDistributionGroupCmdlet.Type = inputRow["GroupType"].ToString(); newDistributionGroupCmdlet.Run(); if (!string.IsNullOrEmpty(newDistributionGroupCmdlet.Error)) { throw new Exception(newDistributionGroupCmdlet.Error); } }