internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
        {
            DS_REPL_NEIGHBOR neighbor = new DS_REPL_NEIGHBOR();
            Marshal.PtrToStructure(addr, neighbor);

            _namingContext = Marshal.PtrToStringUni(neighbor.pszNamingContext);
            _sourceServerDN = Marshal.PtrToStringUni(neighbor.pszSourceDsaDN);

            string transportDN = Marshal.PtrToStringUni(neighbor.pszAsyncIntersiteTransportDN);
            if (transportDN != null)
            {
                string rdn = Utils.GetRdnFromDN(transportDN);
                string transport = (Utils.GetDNComponents(rdn))[0].Value;

                if (String.Compare(transport, "SMTP", StringComparison.OrdinalIgnoreCase) == 0)
                    _transportType = ActiveDirectoryTransportType.Smtp;
                else
                    _transportType = ActiveDirectoryTransportType.Rpc;
            }

            _replicaFlags = (ReplicationNeighborOptions)neighbor.dwReplicaFlags;
            _uuidSourceDsaInvocationID = neighbor.uuidSourceDsaInvocationID;
            _usnLastObjChangeSynced = neighbor.usnLastObjChangeSynced;
            _usnAttributeFilter = neighbor.usnAttributeFilter;
            _timeLastSyncSuccess = DateTime.FromFileTime(neighbor.ftimeLastSyncSuccess);
            _timeLastSyncAttempt = DateTime.FromFileTime(neighbor.ftimeLastSyncAttempt);
            _lastSyncResult = neighbor.dwLastSyncResult;
            _consecutiveSyncFailures = neighbor.cNumConsecutiveSyncFailures;

            _server = server;
            _nameTable = table;
        }
Exemple #2
0
        internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
        {
            DS_REPL_NEIGHBOR structure = new DS_REPL_NEIGHBOR();

            Marshal.PtrToStructure(addr, structure);
            this.namingContext  = Marshal.PtrToStringUni(structure.pszNamingContext);
            this.sourceServerDN = Marshal.PtrToStringUni(structure.pszSourceDsaDN);
            string distinguishedName = Marshal.PtrToStringUni(structure.pszAsyncIntersiteTransportDN);

            if (distinguishedName != null)
            {
                if (string.Compare(Utils.GetDNComponents(Utils.GetRdnFromDN(distinguishedName))[0].Value, "SMTP", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    this.transportType = ActiveDirectoryTransportType.Smtp;
                }
                else
                {
                    this.transportType = ActiveDirectoryTransportType.Rpc;
                }
            }
            this.replicaFlags = (ReplicationNeighborOptions)structure.dwReplicaFlags;
            this.uuidSourceDsaInvocationID = structure.uuidSourceDsaInvocationID;
            this.usnLastObjChangeSynced    = structure.usnLastObjChangeSynced;
            this.usnAttributeFilter        = structure.usnAttributeFilter;
            this.timeLastSyncSuccess       = DateTime.FromFileTime(structure.ftimeLastSyncSuccess);
            this.timeLastSyncAttempt       = DateTime.FromFileTime(structure.ftimeLastSyncAttempt);
            this.lastSyncResult            = structure.dwLastSyncResult;
            this.consecutiveSyncFailures   = structure.cNumConsecutiveSyncFailures;
            this.server    = server;
            this.nameTable = table;
        }
Exemple #3
0
        internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
        {
            DS_REPL_NEIGHBOR dSREPLNEIGHBOR = new DS_REPL_NEIGHBOR();

            Marshal.PtrToStructure(addr, dSREPLNEIGHBOR);
            this.namingContext  = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszNamingContext);
            this.sourceServerDN = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszSourceDsaDN);
            string stringUni = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszAsyncIntersiteTransportDN);

            if (stringUni != null)
            {
                string rdnFromDN = Utils.GetRdnFromDN(stringUni);
                string value     = Utils.GetDNComponents(rdnFromDN)[0].Value;
                if (string.Compare(value, "SMTP", StringComparison.OrdinalIgnoreCase) != 0)
                {
                    this.transportType = ActiveDirectoryTransportType.Rpc;
                }
                else
                {
                    this.transportType = ActiveDirectoryTransportType.Smtp;
                }
            }
            this.replicaFlags = (ReplicationNeighbor.ReplicationNeighborOptions)((long)dSREPLNEIGHBOR.dwReplicaFlags);
            this.uuidSourceDsaInvocationID = dSREPLNEIGHBOR.uuidSourceDsaInvocationID;
            this.usnLastObjChangeSynced    = dSREPLNEIGHBOR.usnLastObjChangeSynced;
            this.usnAttributeFilter        = dSREPLNEIGHBOR.usnAttributeFilter;
            this.timeLastSyncSuccess       = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncSuccess);
            this.timeLastSyncAttempt       = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncAttempt);
            this.lastSyncResult            = dSREPLNEIGHBOR.dwLastSyncResult;
            this.consecutiveSyncFailures   = dSREPLNEIGHBOR.cNumConsecutiveSyncFailures;
            this.server    = server;
            this.nameTable = table;
        }
 internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
 {
     DS_REPL_NEIGHBOR structure = new DS_REPL_NEIGHBOR();
     Marshal.PtrToStructure(addr, structure);
     this.namingContext = Marshal.PtrToStringUni(structure.pszNamingContext);
     this.sourceServerDN = Marshal.PtrToStringUni(structure.pszSourceDsaDN);
     string distinguishedName = Marshal.PtrToStringUni(structure.pszAsyncIntersiteTransportDN);
     if (distinguishedName != null)
     {
         if (string.Compare(Utils.GetDNComponents(Utils.GetRdnFromDN(distinguishedName))[0].Value, "SMTP", StringComparison.OrdinalIgnoreCase) == 0)
         {
             this.transportType = ActiveDirectoryTransportType.Smtp;
         }
         else
         {
             this.transportType = ActiveDirectoryTransportType.Rpc;
         }
     }
     this.replicaFlags = (ReplicationNeighborOptions) structure.dwReplicaFlags;
     this.uuidSourceDsaInvocationID = structure.uuidSourceDsaInvocationID;
     this.usnLastObjChangeSynced = structure.usnLastObjChangeSynced;
     this.usnAttributeFilter = structure.usnAttributeFilter;
     this.timeLastSyncSuccess = DateTime.FromFileTime(structure.ftimeLastSyncSuccess);
     this.timeLastSyncAttempt = DateTime.FromFileTime(structure.ftimeLastSyncAttempt);
     this.lastSyncResult = structure.dwLastSyncResult;
     this.consecutiveSyncFailures = structure.cNumConsecutiveSyncFailures;
     this.server = server;
     this.nameTable = table;
 }
        internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
        {
            DS_REPL_NEIGHBOR neighbor = new DS_REPL_NEIGHBOR();

            Marshal.PtrToStructure(addr, neighbor);

            PartitionName   = Marshal.PtrToStringUni(neighbor.pszNamingContext);
            _sourceServerDN = Marshal.PtrToStringUni(neighbor.pszSourceDsaDN);

            string transportDN = Marshal.PtrToStringUni(neighbor.pszAsyncIntersiteTransportDN);

            if (transportDN != null)
            {
                string rdn       = Utils.GetRdnFromDN(transportDN);
                string transport = (Utils.GetDNComponents(rdn))[0].Value;

                if (string.Equals(transport, "SMTP", StringComparison.OrdinalIgnoreCase))
                {
                    TransportType = ActiveDirectoryTransportType.Smtp;
                }
                else
                {
                    TransportType = ActiveDirectoryTransportType.Rpc;
                }
            }

            ReplicationNeighborOption = (ReplicationNeighborOptions)neighbor.dwReplicaFlags;
            SourceInvocationId        = neighbor.uuidSourceDsaInvocationID;
            UsnLastObjectChangeSynced = neighbor.usnLastObjChangeSynced;
            UsnAttributeFilter        = neighbor.usnAttributeFilter;
            LastSuccessfulSync        = DateTime.FromFileTime(neighbor.ftimeLastSyncSuccess);
            LastAttemptedSync         = DateTime.FromFileTime(neighbor.ftimeLastSyncAttempt);
            LastSyncResult            = neighbor.dwLastSyncResult;
            ConsecutiveFailureCount   = neighbor.cNumConsecutiveSyncFailures;

            _server    = server;
            _nameTable = table;
        }
Exemple #6
0
		internal ReplicationNeighbor(IntPtr addr, DirectoryServer server, Hashtable table)
		{
			DS_REPL_NEIGHBOR dSREPLNEIGHBOR = new DS_REPL_NEIGHBOR();
			Marshal.PtrToStructure(addr, dSREPLNEIGHBOR);
			this.namingContext = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszNamingContext);
			this.sourceServerDN = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszSourceDsaDN);
			string stringUni = Marshal.PtrToStringUni(dSREPLNEIGHBOR.pszAsyncIntersiteTransportDN);
			if (stringUni != null)
			{
				string rdnFromDN = Utils.GetRdnFromDN(stringUni);
				string value = Utils.GetDNComponents(rdnFromDN)[0].Value;
				if (string.Compare(value, "SMTP", StringComparison.OrdinalIgnoreCase) != 0)
				{
					this.transportType = ActiveDirectoryTransportType.Rpc;
				}
				else
				{
					this.transportType = ActiveDirectoryTransportType.Smtp;
				}
			}
			this.replicaFlags = (ReplicationNeighbor.ReplicationNeighborOptions)((long)dSREPLNEIGHBOR.dwReplicaFlags);
			this.uuidSourceDsaInvocationID = dSREPLNEIGHBOR.uuidSourceDsaInvocationID;
			this.usnLastObjChangeSynced = dSREPLNEIGHBOR.usnLastObjChangeSynced;
			this.usnAttributeFilter = dSREPLNEIGHBOR.usnAttributeFilter;
			this.timeLastSyncSuccess = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncSuccess);
			this.timeLastSyncAttempt = DateTime.FromFileTime(dSREPLNEIGHBOR.ftimeLastSyncAttempt);
			this.lastSyncResult = dSREPLNEIGHBOR.dwLastSyncResult;
			this.consecutiveSyncFailures = dSREPLNEIGHBOR.cNumConsecutiveSyncFailures;
			this.server = server;
			this.nameTable = table;
		}