internal static void VerifyIsInScopes(ADObject adObject, ScopeSet scopeSet, Task.TaskErrorLoggingDelegate writeErrorDelegate) { try { ADSession.VerifyIsWithinScopes(adObject, scopeSet.RecipientReadScope, scopeSet.RecipientWriteScopes, scopeSet.ExclusiveRecipientScopes, false); } catch (ADScopeException) { writeErrorDelegate(new MailboxSearchScopeException(adObject.Id.ToString()), ErrorCategory.PermissionDenied, null); } }