Beispiel #1
0
        // Token: 0x06000454 RID: 1108 RVA: 0x0000F700 File Offset: 0x0000D900
        internal static DatabaseId ConvertDatabaseADObjectToDatabaseId(Database adObject)
        {
            if (adObject == null)
            {
                throw new ArgumentNullException("adObject");
            }
            string serverName = adObject.ServerName;
            string text       = adObject.Name;
            Guid   guid       = adObject.Guid;

            if (adObject.Identity != null)
            {
                DatabaseId databaseId = MapiTaskHelper.ConvertDatabaseADObjectIdToDatabaseId((ADObjectId)adObject.Identity);
                if (string.IsNullOrEmpty(serverName))
                {
                    serverName = databaseId.ServerName;
                }
                if (string.IsNullOrEmpty(text))
                {
                    text = databaseId.DatabaseName;
                }
                if (Guid.Empty == guid)
                {
                    guid = databaseId.Guid;
                }
            }
            return(new DatabaseId(null, serverName, text, guid));
        }
Beispiel #2
0
        // Token: 0x06000458 RID: 1112 RVA: 0x0000F868 File Offset: 0x0000DA68
        internal static string GetMailboxLegacyDN(MapiAdministrationSession mapiAdminSession, ADObjectId databaseId, Guid mailboxGuid)
        {
            string               result = null;
            DatabaseId           root   = MapiTaskHelper.ConvertDatabaseADObjectIdToDatabaseId(databaseId);
            MailboxContextFilter filter = new MailboxContextFilter(mailboxGuid);

            MailboxStatistics[] array = null;
            try
            {
                array = mapiAdminSession.Find <MailboxStatistics>(filter, root, QueryScope.SubTree, null, 1);
            }
            catch (MapiObjectNotFoundException)
            {
            }
            if (array != null)
            {
                result = array[0].LegacyDN;
                array[0].Dispose();
            }
            return(result);
        }