Exemplo n.º 1
0
        internal static void ObjectIdSetter(object value, IPropertyBag propertyBag)
        {
            ADObjectId adobjectId = value as ADObjectId;

            if (adobjectId == null)
            {
                throw new ArgumentNullException("Id");
            }
            ulong num;

            if (!ConsumerIdentityHelper.TryGetPuidFromGuid(adobjectId.ObjectGuid, out num))
            {
                throw new ArgumentException("Id.ObjectGuid");
            }
            ulong num2;

            if (!ConsumerIdentityHelper.TryGetPuidFromDN(adobjectId.DistinguishedName, out num2))
            {
                throw new ArgumentException("Id.DistinguishedName");
            }
            if (num != num2)
            {
                throw new ArgumentException("Id");
            }
            propertyBag[MServRecipientSchema.Puid] = num2;
        }
Exemplo n.º 2
0
        public static ADRawEntry PerformMbxLookupByPuid(ADObjectId resultId, Guid mdbGuid, bool isReadOnly, List <MbxPropertyDefinition> properties)
        {
            ulong puid;

            if (ConsumerIdentityHelper.TryGetPuidFromGuid(resultId.ObjectGuid, out puid))
            {
                return(MbxRecipientSession.FindADRawEntryByPuid(puid, mdbGuid, isReadOnly, properties));
            }
            throw new ArgumentException("resultId");
        }
Exemplo n.º 3
0
        protected override IConfigurable PrepareDataObject()
        {
            TaskLogger.LogEnter();
            this.DataObject = (ADUser)base.PrepareDataObject();
            ulong puidNum;

            if (ConsumerIdentityHelper.TryGetPuidFromGuid(this.DataObject.ExchangeGuid, out puidNum))
            {
                base.Fields[ADUserSchema.NetID] = new NetID(ConsumerIdentityHelper.ConvertPuidNumberToPuidString(puidNum));
                TaskLogger.LogExit();
                return(null);
            }
            throw new TaskInvalidOperationException(new LocalizedString(string.Format(CultureInfo.CurrentUICulture, "Could not extract puid from ExchangeGuid for this user", new object[0])));
        }
Exemplo n.º 4
0
        protected override void AfterTargetConnect()
        {
            ADUser aduser = null;
            string text   = base.CachedRequestJob.RemoteHostName;

            if (string.IsNullOrEmpty(text))
            {
                aduser = base.MailboxMerger.DestMailbox.GetADUser();
                IPAddress clusterIp = (IPAddress)aduser[ConsumerMailboxSchema.SatchmoClusterIp];
                text = OlcTopology.Instance.FindServerByClusterIP(clusterIp);
            }
            ulong value;
            int   value2;

            if (base.CachedRequestJob.UserPuid != null && base.CachedRequestJob.OlcDGroup != null)
            {
                value  = (ulong)base.CachedRequestJob.UserPuid.Value;
                value2 = base.CachedRequestJob.OlcDGroup.Value;
            }
            else
            {
                if (aduser == null)
                {
                    aduser = base.MailboxMerger.DestMailbox.GetADUser();
                }
                if (!ConsumerIdentityHelper.TryGetPuidFromGuid(aduser.ExchangeGuid, out value))
                {
                    throw new UnexpectedValuePermanentException(aduser.ExchangeGuid.ToString(), "destUser.ExchangeGuid");
                }
                string text2 = (string)aduser[ConsumerMailboxSchema.SatchmoDGroup];
                if (!int.TryParse(text2, out value2))
                {
                    throw new UnexpectedValuePermanentException(text2, "MServRecipientSchema.SatchmoDGroup");
                }
            }
            base.MailboxMerger.SourceMailbox.ConfigOlc(new OlcMailboxConfiguration
            {
                Puid           = (long)value,
                DGroup         = value2,
                RemoteHostName = text
            });
        }