Exemple #1
0
        internal static byte[] InternalTestGetFakeSerializedBlob()
        {
            ClientSessionInfo clientSessionInfo = new ClientSessionInfo
            {
                EffectiveLogonType   = LogonType.BestAccess,
                ClientInfoString     = "FakeTestSession",
                LogonUserSid         = "S-Fake-Test-SID",
                LogonUserDisplayName = "Fake User Display Name"
            };

            return(clientSessionInfo.ToBytes());
        }
Exemple #2
0
        public static byte[] WrapInfoForRemoteServer(MailboxSession session)
        {
            Util.ThrowOnNullArgument(session, "session");
            if (!session.IsRemote)
            {
                throw new InvalidOperationException("Only remote session supports ClientSessionInfo.");
            }
            if (!session.MailboxOwner.MailboxInfo.Configuration.IsMailboxAuditEnabled)
            {
                return(null);
            }
            IdentityPair      identityPair      = IdentityHelper.GetIdentityPair(session);
            ClientSessionInfo clientSessionInfo = new ClientSessionInfo
            {
                EffectiveLogonType   = COWAudit.ResolveEffectiveLogonType(session, null, null),
                ClientInfoString     = session.ClientInfoString,
                LogonUserSid         = identityPair.LogonUserSid,
                LogonUserDisplayName = identityPair.LogonUserDisplayName
            };

            return(clientSessionInfo.ToBytes());
        }