private void Delete_DistributionGroup(string name) { ExchangePowershell powershell = null; try { this.logger.Warn("Rolling back action... Deleting distribution group " + name); powershell = new ExchangePowershell(StaticSettings.ExchangeURI, StaticSettings.Username, StaticSettings.DecryptedPassword, StaticSettings.ExchangeUseKerberos, StaticSettings.PrimaryDC); powershell.DeleteDistributionGroup(name); this.logger.Warn("Successfully removed distribution group " + name); } catch (Exception ex) { this.logger.Error("Failed to roll back action... Deleting distribution group " + name, ex); } finally { if (powershell != null) powershell.Dispose(); } }