Skip to content

Commit

Permalink
Merge pull request #1779 from Shanefe/RBA_CheckRules
Browse files Browse the repository at this point in the history
RBA Script - Add Delegate Rule Check
  • Loading branch information
bill-long committed Jul 28, 2023
2 parents 7fc7284 + aa8d72f commit 307f609
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Calendar/Get-RBASummary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ function ValidateMailbox {
Write-Host ;
}

# Validate that there are not delegate rules that will block RBA functionality
function ValidateInboxRules {
Write-Host "Checking for Delegate Rules that will block RBA functionality..."
Write-Host -NoNewline "Running : "; Write-Host -ForegroundColor Cyan "Get-InboxRule -mailbox $Identity -IncludeHidden"
$rules = Get-InboxRule -mailbox $Identity -IncludeHidden
# Note as far as I can tell "Delegate Rule <GUID>" is not localized.
if ($rules.Name -like "Delegate Rule*") {
Write-Host -ForegroundColor Red "Error: There is a user style Delegate Rule setup on this resource mailbox. This will block RBA functionality. Please remove the rule via Remove-InboxRule cmdlet and re-run this script."
Write-Host -NoNewline "Rule to look into: "
Write-Host -ForegroundColor Red "$($rules.Name -like "Delegate Rule*")"
Write-Host -ForegroundColor Red "Exiting script."
exit;
}
Write-Host -ForegroundColor Green "Delegate Rules check passes."
}

# Retrieve the CalendarProcessing information
function GetCalendarProcessing {
Write-Host -NoNewline "Running : "; Write-Host -ForegroundColor Cyan "Get-CalendarProcessing -Identity $Identity"
Expand Down Expand Up @@ -476,6 +492,7 @@ function Write-DashLineBoxColor {

# Call the Functions in this order:
ValidateMailbox
ValidateInboxRules
GetCalendarProcessing
EvaluateCalProcessing
ProcessingLogic
Expand Down
2 changes: 1 addition & 1 deletion docs/Calendar/Get-RBASummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Download the latest release: [Get-RBASummary.ps1](https://github.com/microsoft/C

This script runs the Get-CalendarProcessing cmdlet and returns the output with more details in clear English, highlighting the key settings that affect RBA and some of the common errors in configuration.

The script will validate the mailbox is the correct type for RBA to interact with via the Get-Mailbox cmdlet.
The script will also validate the mailbox is the correct type for RBA to interact with (via the Get-Mailbox cmdlet) as well as check for any Delegate rules that would interfere with RBA functionality (via the Get-InboxRules cmdlet).


Syntax:
Expand Down

0 comments on commit 307f609

Please sign in to comment.