Esempio n. 1
0
        private static string ClientRunProcessCommand(string server, Guid processGuid, string componentName, string componentArgument, bool componentRestrictedData, bool componentUnlimited, string userIdentity)
        {
            MdbefPropertyCollection mdbefPropertyCollection = new MdbefPropertyCollection();

            if (!string.IsNullOrEmpty(componentName))
            {
                mdbefPropertyCollection.Add(2466250783U, componentName);
            }
            if (!string.IsNullOrEmpty(componentArgument))
            {
                mdbefPropertyCollection.Add(2466316319U, componentArgument);
            }
            mdbefPropertyCollection.Add(2466381835U, componentRestrictedData);
            mdbefPropertyCollection.Add(2466512907U, componentUnlimited);
            if (!string.IsNullOrEmpty(userIdentity))
            {
                mdbefPropertyCollection.Add(2466447391U, userIdentity);
            }
            byte[] bytes = mdbefPropertyCollection.GetBytes();
            byte[] array;
            using (ProcessAccessRpcClient processAccessRpcClient = new ProcessAccessRpcClient(server, processGuid))
            {
                array = processAccessRpcClient.RunProcessCommand(bytes);
            }
            MdbefPropertyCollection mdbefPropertyCollection2 = MdbefPropertyCollection.Create(array, 0, array.Length);
            object obj = null;

            mdbefPropertyCollection2.TryGetValue(2471559199U, out obj);
            return(obj as string);
        }
        private static byte[] GetTestUserCacheInputBytes(string primarySmtpAddress, SubscriptionCacheAction cacheAction)
        {
            MdbefPropertyCollection mdbefPropertyCollection = new MdbefPropertyCollection();

            mdbefPropertyCollection[2684485663U] = primarySmtpAddress;
            mdbefPropertyCollection[2684420099U] = (int)cacheAction;
            return(mdbefPropertyCollection.GetBytes());
        }
        private static byte[] PackRequest(Guid mailboxGuid, RequestedAction requestedAction, int requestedTokenCount, int totalTokenCount, string clientInfo)
        {
            MdbefPropertyCollection mdbefPropertyCollection = new MdbefPropertyCollection();

            mdbefPropertyCollection.Add(2415984712U, mailboxGuid);
            mdbefPropertyCollection.Add(2416050179U, (int)requestedAction);
            mdbefPropertyCollection.Add(2416115715U, requestedTokenCount);
            mdbefPropertyCollection.Add(2416181251U, totalTokenCount);
            mdbefPropertyCollection.Add(2416312351U, Environment.MachineName);
            mdbefPropertyCollection.Add(2416377887U, ThrottlingRpcClientImpl.currentProcess.ProcessName);
            if (!string.IsNullOrEmpty(clientInfo))
            {
                mdbefPropertyCollection.Add(2416246815U, clientInfo);
            }
            return(mdbefPropertyCollection.GetBytes());
        }
Esempio n. 4
0
 protected override void InternalProcessRecord()
 {
     try
     {
         MessageResubmissionRpcClientImpl messageResubmissionRpcClientImpl = new MessageResubmissionRpcClientImpl(this.Server.Fqdn);
         string[] unresponsivePrimaryServers = (this.UnresponsivePrimaryServers != null) ? this.UnresponsivePrimaryServers.ToArray() : null;
         byte[]   reservedBytes = null;
         if (this.TestOnly)
         {
             MdbefPropertyCollection mdbefPropertyCollection = new MdbefPropertyCollection();
             mdbefPropertyCollection[65547U] = true;
             reservedBytes = mdbefPropertyCollection.GetBytes();
         }
         AddResubmitRequestStatus addResubmitRequestStatus;
         if (string.IsNullOrEmpty(this.conditionalString))
         {
             addResubmitRequestStatus = messageResubmissionRpcClientImpl.AddMdbResubmitRequest((this.CorrelationId == Guid.Empty) ? Guid.NewGuid() : this.CorrelationId, new Guid(this.DataObject.Destination), this.StartTime.ToUniversalTime().Ticks, this.EndTime.ToUniversalTime().Ticks, unresponsivePrimaryServers, reservedBytes);
         }
         else
         {
             addResubmitRequestStatus = messageResubmissionRpcClientImpl.AddConditionalResubmitRequest((this.CorrelationId == Guid.Empty) ? Guid.NewGuid() : this.CorrelationId, this.StartTime.ToUniversalTime().Ticks, this.EndTime.ToUniversalTime().Ticks, this.conditionalString, unresponsivePrimaryServers, reservedBytes);
         }
         if (addResubmitRequestStatus != AddResubmitRequestStatus.Success)
         {
             base.WriteError(new LocalizedException(Strings.AddResubmitRequestFailed(addResubmitRequestStatus)), ErrorCategory.NotSpecified, null);
         }
     }
     catch (RpcException rpcException)
     {
         GetResubmitRequest.ProcessRpcError(rpcException, this.Server.Fqdn, this);
     }
     catch (ResubmitRequestException exception)
     {
         base.WriteError(exception, ErrorCategory.InvalidArgument, null);
     }
     catch (LocalizedException exception2)
     {
         base.WriteError(exception2, ExchangeErrorCategory.Client, null);
     }
 }
Esempio n. 5
0
        public override byte[] RunProcessCommand(byte[] inBlob)
        {
            string componentName       = null;
            string argument            = null;
            bool   allowRestrictedData = false;
            bool   unlimited           = false;
            string userIdentity        = null;
            string text = null;
            MdbefPropertyCollection mdbefPropertyCollection = MdbefPropertyCollection.Create(inBlob, 0, inBlob.Length);
            object obj;

            if (mdbefPropertyCollection.TryGetValue(2466316319U, out obj) && obj is string)
            {
                argument = (string)obj;
            }
            if (mdbefPropertyCollection.TryGetValue(2466250783U, out obj) && obj is string)
            {
                componentName = (string)obj;
            }
            if (mdbefPropertyCollection.TryGetValue(2466381835U, out obj) && obj is bool)
            {
                allowRestrictedData = (bool)obj;
            }
            if (mdbefPropertyCollection.TryGetValue(2466512907U, out obj) && obj is bool)
            {
                unlimited = (bool)obj;
            }
            if (mdbefPropertyCollection.TryGetValue(2466447391U, out obj) && obj is string)
            {
                userIdentity = (string)obj;
            }
            try
            {
                DiagnosableParameters componentParameters = DiagnosableParameters.Create(argument, allowRestrictedData, unlimited, userIdentity);
                text = ProcessAccessManager.RunComponentCommand(componentName, componentParameters);
            }
            catch (XmlException ex)
            {
                StringBuilder stringBuilder = new StringBuilder(100 * ex.Data.Count);
                foreach (object obj2 in ex.Data)
                {
                    KeyValuePair <object, object> keyValuePair = (KeyValuePair <object, object>)obj2;
                    stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "{0}:{1}{2}", new object[]
                    {
                        keyValuePair.Key,
                        keyValuePair.Value,
                        Environment.NewLine
                    });
                }
                text = string.Format(CultureInfo.InvariantCulture, "Message={0}{1}Data={2}{1}Stack={3}", new object[]
                {
                    ex.Message,
                    Environment.NewLine,
                    stringBuilder,
                    ex.StackTrace
                });
            }
            catch (Exception ex2)
            {
                text = ex2.ToString();
            }
            MdbefPropertyCollection mdbefPropertyCollection2 = new MdbefPropertyCollection();

            if (text != null)
            {
                mdbefPropertyCollection2.Add(2471559199U, text);
            }
            return(mdbefPropertyCollection2.GetBytes());
        }