Exemple #1
0
        protected override void InternalValidate()
        {
            ADObjectId adobjectId;

            if (this.InternalIgnoreDefaultScope && !RecipientTaskHelper.IsValidDistinguishedName(this.Identity, out adobjectId))
            {
                base.WriteError(new ArgumentException(Strings.ErrorOnlyDNSupportedWithIgnoreDefaultScope), (ErrorCategory)1000, this.Identity);
            }
            base.InternalValidate();
        }
Exemple #2
0
        // Token: 0x060005C1 RID: 1473 RVA: 0x00015BE0 File Offset: 0x00013DE0
        protected override void InternalValidate()
        {
            SharedTenantConfigurationMode sharedTenantConfigurationMode        = this.SharedTenantConfigurationMode;
            LazilyInitialized <SharedTenantConfigurationState> currentOrgState = this.CurrentOrgState;
            TIdentity identity = this.Identity;

            SharedConfigurationTaskHelper.Validate(this, sharedTenantConfigurationMode, currentOrgState, identity.ToString());
            ADObjectId adobjectId;

            if (this.IgnoreDefaultScope && !RecipientTaskHelper.IsValidDistinguishedName(this.Identity, out adobjectId))
            {
                base.WriteError(new ArgumentException(Strings.ErrorOnlyDNSupportedWithIgnoreDefaultScope), (ErrorCategory)1000, this.Identity);
            }
            base.InternalValidate();
        }
Exemple #3
0
 // Token: 0x060003DE RID: 990 RVA: 0x0000E678 File Offset: 0x0000C878
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter(new object[]
     {
         this.Identity
     });
     if (this.Identity != null && this.InternalIgnoreDefaultScope)
     {
         ADObjectId adobjectId;
         if (!RecipientTaskHelper.IsValidDistinguishedName(this.Identity, out adobjectId))
         {
             base.WriteError(new ArgumentException(Strings.ErrorOnlyDNSupportedWithIgnoreDefaultScope), (ErrorCategory)1000, this.Identity);
         }
         IConfigurable dataObject = RecipientTaskHelper.ResolveDataObject <TDataObject>(base.DataSession, null, base.ServerSettings, this.Identity, this.RootId, base.OptionalIdentityData, base.DomainController, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <TDataObject>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError));
         this.WriteResult(dataObject);
     }
     else
     {
         base.InternalProcessRecord();
     }
     TaskLogger.LogExit();
 }
Exemple #4
0
        internal static IConfigurable ResolveDataObject(IConfigDataProvider readOnlySession, IConfigDataProvider readOnlyConfigurationSession, IConfigDataProvider globalCatalogSession, IIdentityParameter identity, DataAccessHelper.GetDataObjectDelegate getDataObjectHandler, Task.TaskVerboseLoggingDelegate logHandler)
        {
            IConfigurable configurable   = null;
            ADObjectId    adobjectId     = null;
            ADObjectId    rootID         = RecipientTaskHelper.IsValidDistinguishedName(identity, out adobjectId) ? adobjectId.Parent : null;
            Exception     innerException = null;

            if (readOnlySession != null)
            {
                try
                {
                    configurable = getDataObjectHandler(identity, readOnlySession, rootID, null, null, new LocalizedString?(Strings.ErrorObjectNotUnique(identity.ToString())));
                }
                catch (ADTransientException ex)
                {
                    innerException = ex;
                    logHandler(Strings.VerboseCannotReadObject(identity.ToString(), readOnlySession.Source, ex.Message));
                }
                catch (ManagementObjectNotFoundException ex2)
                {
                    innerException = ex2;
                    logHandler(Strings.VerboseCannotReadObject(identity.ToString(), readOnlySession.Source, ex2.Message));
                }
            }
            if (configurable == null && readOnlyConfigurationSession != null)
            {
                try
                {
                    configurable = getDataObjectHandler(identity, readOnlyConfigurationSession, rootID, null, null, new LocalizedString?(Strings.ErrorObjectNotUnique(identity.ToString())));
                }
                catch (ADTransientException ex3)
                {
                    innerException = ex3;
                    logHandler(Strings.VerboseCannotReadObject(identity.ToString(), readOnlyConfigurationSession.Source, ex3.Message));
                }
                catch (ManagementObjectNotFoundException ex4)
                {
                    innerException = ex4;
                    logHandler(Strings.VerboseCannotReadObject(identity.ToString(), readOnlyConfigurationSession.Source, ex4.Message));
                }
            }
            if (configurable == null && globalCatalogSession != null)
            {
                try
                {
                    configurable = getDataObjectHandler(identity, globalCatalogSession, rootID, null, null, new LocalizedString?(Strings.ErrorObjectNotUnique(identity.ToString())));
                }
                catch (ADTransientException ex5)
                {
                    innerException = ex5;
                    logHandler(Strings.VerboseCannotReadObject(identity.ToString(), globalCatalogSession.Source, ex5.Message));
                }
                catch (ManagementObjectNotFoundException ex6)
                {
                    innerException = ex6;
                    logHandler(Strings.VerboseCannotReadObject(identity.ToString(), globalCatalogSession.Source, ex6.Message));
                }
            }
            if (configurable == null)
            {
                throw new ManagementObjectNotFoundException(Strings.ErrorObjectNotFound(identity.ToString()), innerException);
            }
            return(configurable);
        }
        protected override IConfigurable ResolveDataObject()
        {
            IConfigurable configurable   = null;
            Exception     innerException = null;
            ADObjectId    adobjectId     = null;
            ADObjectId    rootID         = RecipientTaskHelper.IsValidDistinguishedName(this.Identity, out adobjectId) ? adobjectId.Parent : null;

            try
            {
                configurable = base.GetDataObject <ADRecipient>(this.Identity, base.DataSession, rootID, null, new LocalizedString?(Strings.ErrorRecipientNotUnique(this.Identity.ToString())));
            }
            catch (ADTransientException ex)
            {
                innerException = ex;
                base.WriteVerbose(Strings.VerboseCannotReadObject(this.Identity.ToString(), base.DataSession.Source, ex.Message));
            }
            catch (ADOperationException ex2)
            {
                innerException = ex2;
                base.WriteVerbose(Strings.VerboseCannotReadObject(this.Identity.ToString(), base.DataSession.Source, ex2.Message));
            }
            catch (ManagementObjectNotFoundException ex3)
            {
                innerException = ex3;
                base.WriteVerbose(Strings.VerboseCannotReadObject(this.Identity.ToString(), base.DataSession.Source, ex3.Message));
            }
            if (configurable == null)
            {
                base.WriteError(new ManagementObjectNotFoundException(Strings.ErrorObjectNotFound(this.Identity.ToString()), innerException), ErrorCategory.ObjectNotFound, this.Identity);
            }
            if (this.globalCatalog == null || (base.DomainController == null && !StringComparer.InvariantCultureIgnoreCase.Equals(this.configurationSession.DomainController, ((ADObject)configurable).OriginatingServer)))
            {
                if (base.DomainController == null)
                {
                    ADObject          adobject          = (ADObject)configurable;
                    string            originatingServer = adobject.OriginatingServer;
                    ADSessionSettings sessionSettings   = ADSessionSettings.FromRootOrgScopeSet();
                    if (!adobject.OrganizationId.Equals(OrganizationId.ForestWideOrgId))
                    {
                        sessionSettings = ADSessionSettings.FromAccountPartitionRootOrgScopeSet(adobject.OrganizationId.PartitionId);
                    }
                    this.configurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(originatingServer, true, ConsistencyMode.PartiallyConsistent, base.NetCredential, sessionSettings, 210, "ResolveDataObject", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\recipient\\UpdateRecipient.cs");
                }
                string text = NativeHelpers.CanonicalNameFromDistinguishedName(this.configurationSession.GetRootDomainNamingContextFromCurrentReadConnection());
                this.globalCatalog = null;
                if (this.IsServerSuitableAsGC(this.configurationSession.DomainController, this.configurationSession.NetworkCredential))
                {
                    this.globalCatalog = this.configurationSession.DomainController;
                }
                else
                {
                    NetworkCredential             credentials        = ADForest.IsLocalForestFqdn(text) ? null : this.configurationSession.NetworkCredential;
                    ADForest                      forest             = ADForest.GetForest(text, credentials);
                    ReadOnlyCollection <ADServer> readOnlyCollection = forest.FindAllGlobalCatalogs(false);
                    if (readOnlyCollection != null && readOnlyCollection.Count != 0)
                    {
                        foreach (ADServer adserver in readOnlyCollection)
                        {
                            if (this.IsServerSuitableAsGC(adserver.DnsHostName, this.configurationSession.NetworkCredential))
                            {
                                this.globalCatalog = adserver.DnsHostName;
                                break;
                            }
                        }
                    }
                    if (string.IsNullOrEmpty(this.globalCatalog))
                    {
                        base.WriteError(new InvalidOperationException(Strings.ErrorNoGlobalGatalogFound(text)), (ErrorCategory)1011, this.Identity);
                    }
                }
                if (ADForest.IsLocalForestFqdn(text) || !OrganizationId.ForestWideOrgId.Equals(base.OrgWideSessionSettings.CurrentOrganizationId))
                {
                    this.domainRecipientSession.LinkResolutionServer = this.localForestLinkResolutionServer;
                }
                else
                {
                    this.domainRecipientSession.LinkResolutionServer = null;
                }
            }
            return(configurable);
        }