private RopLogonRequest GetRopLogonRequest()
{
RopLogonRequest logonRop = new RopLogonRequest();
logonRop.RopId = (byte)RopId.RopLogon; // RopId 0XFE indicates RopLogon.
logonRop.LogonId = ConstValues.LogonId; // The logonId 0x00 is associated with this operation.
logonRop.OutputHandleIndex = 0x00; // This index specifies the location 0x00 in the Server Object Handle Table where the handle for the output Server Object is stored.
string userDN = this.AdminUserDN + "\0"; // A null-terminated string that specifies the DN of the AdminUser who is requesting the connection.
logonRop.StoreState = 0; // A flags structure. This field MUST be set to 0x00000000.
logonRop.LogonFlags = 0x01; // Logon to a private mailbox.
logonRop.OpenFlags = 0x01000000; // For a private-mailbox logon, the USE_PER_MDB_REPLID_MAPPING flag should be set.
logonRop.EssdnSize = (ushort)System.Text.Encoding.ASCII.GetByteCount(userDN);
logonRop.Essdn = System.Text.Encoding.ASCII.GetBytes(userDN);
return logonRop;
}