Ejemplo n.º 1
0
        private MailboxSession CreateMailboxSession()
        {
            ExTraceGlobals.SharingTracer.TraceDebug <SecurityIdentifier>((long)this.GetHashCode(), "Create mailbox session as SystemService for sid {0}.", this.sid);
            MailboxSession mailboxSession = MailboxSession.OpenAsSystemService(ExchangePrincipal.FromUserSid(this.RecipientSession, this.sid), Thread.CurrentThread.CurrentCulture, "Client=AS;Action=PublishedFolder");

            if (this.budget != null)
            {
                mailboxSession.AccountingObject = this.budget;
            }
            mailboxSession.ExTimeZone = (TimeZoneHelper.GetUserTimeZone(mailboxSession) ?? ExTimeZone.CurrentTimeZone);
            return(mailboxSession);
        }