Example #1
0
        // Token: 0x0600045D RID: 1117 RVA: 0x0000F9E4 File Offset: 0x0000DBE4
        private static void VerifyDatabaseIsWithinScope(ADSessionSettings sessionSettings, Database database, Task.ErrorLoggerDelegate errorHandler, bool includeCheckForServer)
        {
            if (sessionSettings == null)
            {
                throw new ArgumentNullException("sessionSettings");
            }
            if (database == null)
            {
                throw new ArgumentNullException("database");
            }
            if (errorHandler == null)
            {
                throw new ArgumentNullException("errorHandler");
            }
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(false, ConsistencyMode.PartiallyConsistent, sessionSettings, 613, "VerifyDatabaseIsWithinScope", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\MapiTaskHelper.cs");
            ADScopeException ex;

            if (!topologyConfigurationSession.TryVerifyIsWithinScopes(database, true, out ex))
            {
                errorHandler(new TaskInvalidOperationException(Strings.ErrorIsOutOfDatabaseScopeNoServerCheck(database.Name, ex.Message)), ExchangeErrorCategory.Authorization, null);
            }
            if (includeCheckForServer)
            {
                MapiTaskHelper.VerifyServerIsWithinScope(database, errorHandler, topologyConfigurationSession);
            }
        }
Example #2
0
        // Token: 0x0600045C RID: 1116 RVA: 0x0000F930 File Offset: 0x0000DB30
        internal static void VerifyServerIsWithinScope(Database database, Task.ErrorLoggerDelegate errorHandler, ITopologyConfigurationSession adConfigSession)
        {
            ADObjectId[] array = database.IsExchange2009OrLater ? database.Servers : new ADObjectId[]
            {
                database.Server
            };
            if (array == null || array.Length == 0)
            {
                errorHandler(new NoServersForDatabaseException(database.Name), ExchangeErrorCategory.Client, null);
            }
            bool             flag = false;
            ADScopeException ex   = null;

            foreach (ADObjectId adObjectId in array)
            {
                Server mailboxServer = MapiTaskHelper.GetMailboxServer(new ServerIdParameter(adObjectId), adConfigSession, errorHandler);
                if (adConfigSession.TryVerifyIsWithinScopes(mailboxServer, true, out ex))
                {
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                errorHandler(new IsOutofDatabaseScopeException(database.Name, ex.Message), ExchangeErrorCategory.Authorization, null);
            }
        }
Example #3
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));
        }
Example #4
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);
        }
Example #5
0
 // Token: 0x0600045B RID: 1115 RVA: 0x0000F924 File Offset: 0x0000DB24
 internal static void VerifyDatabaseIsWithinScope(ADSessionSettings sessionSettings, Database database, Task.ErrorLoggerDelegate errorHandler)
 {
     MapiTaskHelper.VerifyDatabaseIsWithinScope(sessionSettings, database, errorHandler, false);
 }