예제 #1
0
 public void Create()
 {
     this.Init();
     DebugLogger.WriteLine("ADActiveObject", string.Concat("Create called for ", this._adObject.DistinguishedName));
     if (this._adObject.ObjectClass != null)
     {
         DirectoryAttribute[] directoryAttributeArray = new DirectoryAttribute[this._adObject.NonNullCount - 1];
         int  num  = 0;
         bool flag = false;
         foreach (KeyValuePair <string, ADPropertyValueCollection> keyValuePair in this._adObject)
         {
             string key = keyValuePair.Key;
             if (flag || string.Compare(key, "distinguishedName", StringComparison.OrdinalIgnoreCase) != 0)
             {
                 DirectoryAttribute directoryAttribute = this.CreateDirectoryAttribute(key, keyValuePair.Value, null);
                 if (directoryAttribute == null)
                 {
                     continue;
                 }
                 directoryAttributeArray[num] = directoryAttribute;
                 num++;
             }
             else
             {
                 flag = true;
             }
         }
         ADAddRequest aDAddRequest = new ADAddRequest(this._adObject.DistinguishedName, directoryAttributeArray);
         if (this._sdFlags != SecurityMasks.None)
         {
             aDAddRequest.Controls.Add(new SecurityDescriptorFlagControl(this._sdFlags));
         }
         this._syncOps.Add(this._sessionHandle, aDAddRequest);
         DebugLogger.WriteLine("ADActiveObject", string.Concat("Create succeeded for ", this._adObject.DistinguishedName));
         return;
     }
     else
     {
         DebugLogger.LogWarning("ADActiveObject", "Create called with null objectClass");
         throw new ArgumentNullException("objectClass");
     }
 }
예제 #2
0
		ADAddResponse Microsoft.ActiveDirectory.Management.IADSyncOperations.Add(ADSessionHandle handle, ADAddRequest request)
		{
			ADAddResponse aDAddResponse = null;
			AdwsConnection internalHandle = this.GetInternalHandle(handle);
			if (internalHandle != null)
			{
				aDAddResponse = internalHandle.Create(request);
				this.CheckAndThrowReferralException(aDAddResponse);
				ADStoreAccess.ThrowExceptionForResultCodeError(aDAddResponse.ResultCode, aDAddResponse.ErrorMessage, null);
			}
			return aDAddResponse;
		}
        ADAddResponse Microsoft.ActiveDirectory.Management.IADSyncOperations.Add(ADSessionHandle handle, ADAddRequest request)
        {
            ADAddResponse aDAddResponse = null;
            ADDirectoryServiceConnection internalHandle = this.GetInternalHandle(handle);

            if (internalHandle != null)
            {
                aDAddResponse = internalHandle.Create(request);
                this.CheckAndThrowReferralException(aDAddResponse);
                ADStoreAccess.ThrowExceptionForResultCodeError(aDAddResponse.ResultCode, aDAddResponse.ErrorMessage, null);
            }
            return(aDAddResponse);
        }
 public ADAddResponse Add(ADSessionHandle handle, ADAddRequest request)
 {
     throw new NotImplementedException();
 }
예제 #5
0
		public void Create()
		{
			this.Init();
			DebugLogger.WriteLine("ADActiveObject", string.Concat("Create called for ", this._adObject.DistinguishedName));
			if (this._adObject.ObjectClass != null)
			{
				DirectoryAttribute[] directoryAttributeArray = new DirectoryAttribute[this._adObject.NonNullCount - 1];
				int num = 0;
				bool flag = false;
				foreach (KeyValuePair<string, ADPropertyValueCollection> keyValuePair in this._adObject)
				{
					string key = keyValuePair.Key;
					if (flag || string.Compare(key, "distinguishedName", StringComparison.OrdinalIgnoreCase) != 0)
					{
						DirectoryAttribute directoryAttribute = this.CreateDirectoryAttribute(key, keyValuePair.Value, null);
						if (directoryAttribute == null)
						{
							continue;
						}
						directoryAttributeArray[num] = directoryAttribute;
						num++;
					}
					else
					{
						flag = true;
					}
				}
				ADAddRequest aDAddRequest = new ADAddRequest(this._adObject.DistinguishedName, directoryAttributeArray);
				if (this._sdFlags != SecurityMasks.None)
				{
					aDAddRequest.Controls.Add(new SecurityDescriptorFlagControl(this._sdFlags));
				}
				this._syncOps.Add(this._sessionHandle, aDAddRequest);
				DebugLogger.WriteLine("ADActiveObject", string.Concat("Create succeeded for ", this._adObject.DistinguishedName));
				return;
			}
			else
			{
				DebugLogger.LogWarning("ADActiveObject", "Create called with null objectClass");
				throw new ArgumentNullException("objectClass");
			}
		}
		public ADAddResponse Add (ADSessionHandle handle, ADAddRequest request)
		{
			throw new NotImplementedException ();
		}