protected override void InternalProcessRecord() { IConfigurationSession configurationSession = (IConfigurationSession)base.DataSession; configurationSession.DeleteTree(base.DataObject, delegate(ADTreeDeleteNotFinishedException de) { if (de != null) { base.WriteVerbose(de.LocalizedString); } }); }
private void RemoveEdgeSyncedObjects <T>(IConfigurationSession scSession) where T : ADConfigurationObject, new() { ADPagedReader <T> adpagedReader = scSession.FindPaged <T>(null, QueryScope.SubTree, null, null, 0); foreach (T t in adpagedReader) { scSession.DeleteTree(t, delegate(ADTreeDeleteNotFinishedException de) { base.WriteVerbose(de.LocalizedString); }); } }
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); } }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(); if (this.Recursive) { IConfigurationSession configurationSession = (IConfigurationSession)base.DataSession; List <ADObjectId> list = new List <ADObjectId>(); try { this.currentProcent = 0; ADPagedReader <AddressBookBase> adpagedReader = configurationSession.FindPaged <AddressBookBase>(base.DataObject.Id, QueryScope.SubTree, new ComparisonFilter(ComparisonOperator.NotEqual, ADObjectSchema.Id, base.DataObject.Id), null, 0); foreach (AddressBookBase addressBookBase in adpagedReader) { list.Add(addressBookBase.Id); if (list.Count % ADGenericPagedReader <AddressBookBase> .DefaultPageSize == 0) { this.MoveToNextPercent(); base.WriteProgress(Strings.ProgressActivityRemovingAddressListTree(base.DataObject.Id.ToString()), Strings.ProgressStatusReadingAddressListTree(list.Count), this.currentProcent); } } list.Add(base.DataObject.Id); if (this.currentProcent != 0) { this.ReportDeleteTreeProgress(null); } configurationSession.DeleteTree(base.DataObject, new TreeDeleteNotFinishedHandler(this.ReportDeleteTreeProgress)); } catch (DataSourceTransientException exception) { base.WriteError(exception, ErrorCategory.WriteError, base.DataObject.Identity); TaskLogger.LogExit(); return; } try { UpdateAddressBookBase <AddressListIdParameter> .UpdateRecipients(base.DataObject, list.ToArray(), base.DomainController, base.TenantGlobalCatalogSession, new Task.TaskWarningLoggingDelegate(this.WriteWarning), new WriteProgress(base.WriteProgress), this); goto IL_206; } catch (DataSourceTransientException ex) { this.WriteWarning(Strings.ErrorReadMatchingRecipients(this.Identity.ToString(), base.DataObject.LdapRecipientFilter, ex.Message)); TaskLogger.Trace("Exception is raised while reading recipients: {0}", new object[] { ex.ToString() }); goto IL_206; } catch (DataSourceOperationException ex2) { this.WriteWarning(Strings.ErrorReadMatchingRecipients(this.Identity.ToString(), base.DataObject.LdapRecipientFilter, ex2.Message)); TaskLogger.Trace("Exception is raised while reading recipients matching filter: {0}", new object[] { ex2.ToString() }); goto IL_206; } } base.InternalProcessRecord(); IL_206: TaskLogger.LogExit(); }