public static void RemoveFFOGroup(DataRow inputRow, DataTable table, DataObjectStore store) { RemoveDistributionGroupCmdlet removeDistributionGroupCmdlet = new RemoveDistributionGroupCmdlet(); removeDistributionGroupCmdlet.Authenticator = PswsAuthenticator.Create(); removeDistributionGroupCmdlet.HostServerName = AppConfigLoader.GetConfigStringValue("PswsHostName", null); removeDistributionGroupCmdlet.Identity = ((Identity)inputRow["Identity"]).RawIdentity; removeDistributionGroupCmdlet.Run(); if (!string.IsNullOrEmpty(removeDistributionGroupCmdlet.Error)) { throw new Exception(removeDistributionGroupCmdlet.Error); } }
protected override void InternalProcessRecord() { try { RemoveDistributionGroupCmdlet removeDistributionGroupCmdlet = new RemoveDistributionGroupCmdlet(); ADObjectId executingUserId; base.ExchangeRunspaceConfig.TryGetExecutingUserId(out executingUserId); removeDistributionGroupCmdlet.Authenticator = Authenticator.Create(base.CurrentOrganizationId, executingUserId); removeDistributionGroupCmdlet.HostServerName = EOPRecipient.GetPsWsHostServerName(); if (string.IsNullOrEmpty(this.ExternalDirectoryObjectId) && this.Identity == null) { base.ThrowTaskError(new ArgumentException(CoreStrings.MissingIdentityParameter.ToString())); } EOPRecipient.SetProperty(removeDistributionGroupCmdlet, Parameters.Identity, string.IsNullOrEmpty(this.ExternalDirectoryObjectId) ? this.Identity.ToString() : this.ExternalDirectoryObjectId); EOPRecipient.SetProperty(removeDistributionGroupCmdlet, Parameters.Organization, base.Organization); removeDistributionGroupCmdlet.Run(); EOPRecipient.CheckForError(this, removeDistributionGroupCmdlet); } catch (Exception e) { base.ThrowAndLogTaskError(e); } }