Example #1
0
        internal static void SerializeIdentityCustomSoapHeaders(XmlSerializer xmlSerializer, XmlWriter writer, string identity)
        {
            OpenAsAdminOrSystemServiceType o = new OpenAsAdminOrSystemServiceType
            {
                ConnectingSID = new ConnectingSIDType
                {
                    Item = new PrimarySmtpAddressType
                    {
                        Value = identity
                    }
                },
                LogonType           = SpecialLogonType.Admin,
                BudgetType          = 1,
                BudgetTypeSpecified = true
            };

            xmlSerializer.Serialize(writer, o);
        }
Example #2
0
        public static OpenAsAdminOrSystemServiceType CreateSpecialLogonAuthenticationHeader(IExchangePrincipal mailbox, SpecialLogonType logonType, OpenAsAdminOrSystemServiceBudgetTypeType budgetType, ExchangeVersion requestedServerVersion)
        {
            OpenAsAdminOrSystemServiceType openAsAdminOrSystemServiceType = new OpenAsAdminOrSystemServiceType
            {
                ConnectingSID = new ConnectingSIDType
                {
                    Item = new PrimarySmtpAddressType
                    {
                        Value = mailbox.MailboxInfo.PrimarySmtpAddress.ToString()
                    }
                },
                LogonType = logonType
            };

            if (requestedServerVersion >= 4)
            {
                openAsAdminOrSystemServiceType.BudgetType          = (int)budgetType;
                openAsAdminOrSystemServiceType.BudgetTypeSpecified = true;
            }
            return(openAsAdminOrSystemServiceType);
        }
Example #3
0
 private void OnSerializeCustomSoapHeaders(XmlWriter writer)
 {
     if (this.groupId != null && this.groupId.GroupType != GroupType.CrossPremise && this.policy != null && this.policy.CallerInfo.IsOpenAsAdmin)
     {
         Recorder.Trace(5L, TraceType.InfoTrace, "ExchangeProxy.OnSerializeCustomSoapHeaders Admin");
         XmlSerializer xmlSerializer      = new XmlSerializer(typeof(OpenAsAdminOrSystemServiceType));
         OpenAsAdminOrSystemServiceType o = new OpenAsAdminOrSystemServiceType
         {
             ConnectingSID = new ConnectingSIDType
             {
                 Item = new PrimarySmtpAddressType
                 {
                     Value = this.policy.CallerInfo.PrimarySmtpAddress
                 }
             },
             LogonType           = SpecialLogonType.Admin,
             BudgetType          = 1,
             BudgetTypeSpecified = true
         };
         xmlSerializer.Serialize(writer, o);
     }
 }