internal ConfigurationSet(DirectoryContext context, string configSetName, DirectoryEntryManager directoryEntryMgr)
 {
     this.cachedSecurityLevel = ~ReplicationSecurityLevel.NegotiatePassThrough;
     this.context             = context;
     this.configSetName       = configSetName;
     this.directoryEntryMgr   = directoryEntryMgr;
 }
 internal ConfigurationSet(DirectoryContext context, string configSetName, DirectoryEntryManager directoryEntryMgr)
 {
     this.cachedSecurityLevel = ~ReplicationSecurityLevel.NegotiatePassThrough;
     this.context = context;
     this.configSetName = configSetName;
     this.directoryEntryMgr = directoryEntryMgr;
 }
Пример #3
0
 internal ConfigurationSet(DirectoryContext context, string configSetName, DirectoryEntryManager directoryEntryMgr)
 {
     this.cachedSecurityLevel = ReplicationSecurityLevel.MutualAuthentication | ReplicationSecurityLevel.Negotiate;
     this.context             = context;
     this.configSetName       = configSetName;
     this.directoryEntryMgr   = directoryEntryMgr;
 }
Пример #4
0
 public ReplicationSecurityLevel GetSecurityLevel()
 {
     CheckIfDisposed();
     if (_cachedSecurityLevel == (ReplicationSecurityLevel)(-1))
     {
         DirectoryEntry configEntry = _directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
         _cachedSecurityLevel = (ReplicationSecurityLevel)((int)PropertyManager.GetPropertyValue(_context, configEntry, PropertyManager.MsDSReplAuthenticationMode));
     }
     return(_cachedSecurityLevel);
 }
 public ReplicationSecurityLevel GetSecurityLevel()
 {
     this.CheckIfDisposed();
     if (this.cachedSecurityLevel == ~ReplicationSecurityLevel.NegotiatePassThrough)
     {
         DirectoryEntry cachedDirectoryEntry = this.directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
         this.cachedSecurityLevel = (ReplicationSecurityLevel)((int)PropertyManager.GetPropertyValue(this.context, cachedDirectoryEntry, PropertyManager.MsDSReplAuthenticationMode));
     }
     return(this.cachedSecurityLevel);
 }
 public void SetSecurityLevel(ReplicationSecurityLevel securityLevel)
 {
     this.CheckIfDisposed();
     if ((securityLevel < ReplicationSecurityLevel.NegotiatePassThrough) || (securityLevel > ReplicationSecurityLevel.MutualAuthentication))
     {
         throw new InvalidEnumArgumentException("securityLevel", (int)securityLevel, typeof(ReplicationSecurityLevel));
     }
     try
     {
         DirectoryEntry cachedDirectoryEntry = this.directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
         cachedDirectoryEntry.Properties[PropertyManager.MsDSReplAuthenticationMode].Value = (int)securityLevel;
         cachedDirectoryEntry.CommitChanges();
     }
     catch (COMException exception)
     {
         throw ExceptionHelper.GetExceptionFromCOMException(this.context, exception);
     }
     this.cachedSecurityLevel = ~ReplicationSecurityLevel.NegotiatePassThrough;
 }
Пример #7
0
        public void SetSecurityLevel(ReplicationSecurityLevel securityLevel)
        {
            CheckIfDisposed();
            if (securityLevel < ReplicationSecurityLevel.NegotiatePassThrough || securityLevel > ReplicationSecurityLevel.MutualAuthentication)
            {
                throw new InvalidEnumArgumentException(nameof(securityLevel), (int)securityLevel, typeof(ReplicationSecurityLevel));
            }

            try
            {
                DirectoryEntry configEntry = _directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
                configEntry.Properties[PropertyManager.MsDSReplAuthenticationMode].Value = (int)securityLevel;
                configEntry.CommitChanges();
            }
            catch (COMException e)
            {
                throw ExceptionHelper.GetExceptionFromCOMException(_context, e);
            }

            // invalidate the cached entry
            _cachedSecurityLevel = (ReplicationSecurityLevel)(-1);
        }
 public void SetSecurityLevel(ReplicationSecurityLevel securityLevel)
 {
 }
Пример #9
0
		public void SetSecurityLevel(ReplicationSecurityLevel securityLevel)
		{
			this.CheckIfDisposed();
			if (securityLevel < ReplicationSecurityLevel.NegotiatePassThrough || securityLevel > ReplicationSecurityLevel.MutualAuthentication)
			{
				throw new InvalidEnumArgumentException("securityLevel", (int)securityLevel, typeof(ReplicationSecurityLevel));
			}
			else
			{
				try
				{
					DirectoryEntry cachedDirectoryEntry = this.directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
					cachedDirectoryEntry.Properties[PropertyManager.MsDSReplAuthenticationMode].Value = (int)securityLevel;
					cachedDirectoryEntry.CommitChanges();
				}
				catch (COMException cOMException1)
				{
					COMException cOMException = cOMException1;
					throw ExceptionHelper.GetExceptionFromCOMException(this.context, cOMException);
				}
				this.cachedSecurityLevel = ReplicationSecurityLevel.MutualAuthentication | ReplicationSecurityLevel.Negotiate;
				return;
			}
		}
Пример #10
0
		public ReplicationSecurityLevel GetSecurityLevel()
		{
			this.CheckIfDisposed();
			if (this.cachedSecurityLevel == (ReplicationSecurityLevel.MutualAuthentication | ReplicationSecurityLevel.Negotiate))
			{
				DirectoryEntry cachedDirectoryEntry = this.directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
				this.cachedSecurityLevel = (ReplicationSecurityLevel)((int)PropertyManager.GetPropertyValue(this.context, cachedDirectoryEntry, PropertyManager.MsDSReplAuthenticationMode));
			}
			return this.cachedSecurityLevel;
		}
Пример #11
0
		internal ConfigurationSet(DirectoryContext context, string configSetName, DirectoryEntryManager directoryEntryMgr)
		{
			this.cachedSecurityLevel = ReplicationSecurityLevel.MutualAuthentication | ReplicationSecurityLevel.Negotiate;
			this.context = context;
			this.configSetName = configSetName;
			this.directoryEntryMgr = directoryEntryMgr;
		}
	public void SetSecurityLevel(ReplicationSecurityLevel securityLevel) {}
Пример #13
0
        public void SetSecurityLevel(ReplicationSecurityLevel securityLevel)
        {
            CheckIfDisposed();
            if (securityLevel < ReplicationSecurityLevel.NegotiatePassThrough || securityLevel > ReplicationSecurityLevel.MutualAuthentication)
            {
                throw new InvalidEnumArgumentException("securityLevel", (int)securityLevel, typeof(ReplicationSecurityLevel));
            }

            try
            {
                DirectoryEntry configEntry = _directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
                configEntry.Properties[PropertyManager.MsDSReplAuthenticationMode].Value = (int)securityLevel;
                configEntry.CommitChanges();
            }
            catch (COMException e)
            {
                throw ExceptionHelper.GetExceptionFromCOMException(_context, e);
            }

            // invalidate the cached entry
            _cachedSecurityLevel = (ReplicationSecurityLevel)(-1);
        }
Пример #14
0
 public ReplicationSecurityLevel GetSecurityLevel()
 {
     CheckIfDisposed();
     if (_cachedSecurityLevel == (ReplicationSecurityLevel)(-1))
     {
         DirectoryEntry configEntry = _directoryEntryMgr.GetCachedDirectoryEntry(WellKnownDN.ConfigurationNamingContext);
         _cachedSecurityLevel = (ReplicationSecurityLevel)((int)PropertyManager.GetPropertyValue(_context, configEntry, PropertyManager.MsDSReplAuthenticationMode));
     }
     return _cachedSecurityLevel;
 }