private void HandleRemoveInsideOrg(IConfigurationSession scSession) { Server dataObject = base.DataObject; if (!dataObject.IsEdgeServer) { base.WriteError(new InvalidOperationException(Strings.WrongSubscriptionIdentity), ErrorCategory.InvalidOperation, null); } try { this.RemoveEdgeFromConnectorSourceServers(scSession, dataObject); AdamUserManagement.RemoveSubscriptionCredentialsOnAllBHs(dataObject.Fqdn); scSession.DeleteTree(base.DataObject, delegate(ADTreeDeleteNotFinishedException de) { base.WriteVerbose(de.LocalizedString); }); } catch (ADTransientException exception) { base.WriteError(exception, ErrorCategory.InvalidOperation, null); } }
private void HandleRemoveOnEdge(ITopologyConfigurationSession scSession) { try { this.RemoveEdgeSyncedObjects <DomainContentConfig>(scSession); this.RemoveEdgeSyncedObjects <MicrosoftExchangeRecipient>(scSession); this.RemoveEdgeSyncedObjects <AcceptedDomain>(scSession); this.RemoveEdgeSyncedObjects <MessageClassification>(scSession); this.RemoveEdgeSyncedObjects <MailGateway>(scSession); this.RemoveEdgeSyncedHubServerObjects(scSession); AdamUserManagement.RemoveAllADAMPrincipals(); base.DataObject.EdgeSyncLease = null; base.DataObject.EdgeSyncCredentials = null; base.DataObject.EdgeSyncStatus = null; base.DataObject.GatewayEdgeSyncSubscribed = false; base.DataObject.EdgeSyncCookies = null; base.DataObject.EdgeSyncSourceGuid = null; scSession.Save(base.DataObject); this.RestoreTransportSettings(scSession); if (this.force || base.ShouldContinue(Strings.ConfirmationMessageRemoveEdgeSubscriptionRecipients)) { this.RemoveAllEdgeSyncedRecipients(); } } catch (ADTransientException exception) { base.WriteError(exception, ErrorCategory.InvalidOperation, null); } catch (MessageSecurityException exception2) { base.WriteError(exception2, ErrorCategory.InvalidOperation, null); } catch (LdapException exception3) { base.WriteError(exception3, ErrorCategory.InvalidOperation, null); } }