Skip to content

Commit

Permalink
Merge pull request #2080 from microsoft/main
Browse files Browse the repository at this point in the history
Release 5-1-24
  • Loading branch information
dpaulson45 authored May 1, 2024
2 parents 0a0ec62 + 6e1f777 commit 4ff2634
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 30 deletions.
55 changes: 41 additions & 14 deletions Calendar/Get-RBASummary.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,26 @@ if (Test-ScriptVersion -AutoUpdate) {

Write-Verbose "Script Versions: $BuildVersion"

$SummaryFilename = "RBA-Summary-For_$($Identity.Split('@')[0])_$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss')).txt"
Write-Host "`r`nRBA Summary Output saved as [" -NoNewline
Write-Host -ForegroundColor Cyan $SummaryFilename -NoNewline
Write-Host "] in the current directory."
Start-Transcript -Path $SummaryFilename
Write-Host "`r`n"

function ValidateMailbox {
Write-Host -NoNewline "Running : "; Write-Host -ForegroundColor Cyan "Get-Mailbox -Identity $Identity"
$script:Mailbox = Get-Mailbox -Identity $Identity

# check we get a response
if ($null -eq $script:Mailbox) {
Write-Host -ForegroundColor Red "Get-Mailbox returned null. Make sure you Import-Module ExchangeOnlineManagement and Connect-ExchangeOnline. Exiting script."
Stop-Transcript
exit
} else {
if ($script:Mailbox.RecipientTypeDetails -ne "RoomMailbox" -and $script:Mailbox.RecipientTypeDetails -ne "EquipmentMailbox") {
Write-Host -ForegroundColor Red "The mailbox is not a Room Mailbox / Equipment Mailbox. RBA will only work with these. Exiting script."
Stop-Transcript
exit
}
if ($script:Mailbox.ResourceType -eq "Workspace") {
Expand All @@ -60,6 +69,7 @@ function ValidateMailbox {
Write-Host -ForegroundColor Red "Make sure you are running from the correct forest. Get-Place does not cross forest boundaries."
Write-Host "Hint Forest is likely something like: [$($script:Mailbox.Database.split("DG")[0])]."
Write-Error "Exiting Script."
Stop-Transcript
exit
}

Expand All @@ -71,24 +81,25 @@ function ValidateMailbox {
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
[array]$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."
Stop-Transcript
exit
} elseif ($rules.Name -like "REDACTED-*") {
Write-Host -ForegroundColor Yellow "Warning: No PII Access to MB so cannot check for Delegate Rules."
Write-Host -ForegroundColor Red " --- Inbox Rules needs to be checked manually for any Delegate Rules. --"
Write-Host -ForegroundColor Yellow "To gain PII access, Mailbox is located on $($mailbox.Database) on server $($mailbox.ServerName)"
if ($rules.count -eq 1) {
if ($null -eq $rules.count -or $rules.count -eq 1) {
Write-Host -ForegroundColor Yellow "Warning: One rule has been found, which is likely the default Junk Mail rule."
Write-Host -ForegroundColor Yellow "Warning: You should verify that this is not a Delegate Rule setup on this resource mailbox. Delegate rules will block RBA functionality. Please remove the rule via Remove-InboxRule cmdlet and re-run this script."
} elseif ($rules.count -gt 1) {
Write-Host -ForegroundColor Yellow "Warning: Multiple rules have been found on this resource mailbox. Only the Default Junk Mail rule is expected. Depending on the rules setup, this may block RBA functionality."
Write-Host -ForegroundColor Yellow "Warning: Please remove the rule(s) via Remove-InboxRule cmdlet and re-run this script."
Write-Host -ForegroundColor Red " --- Inbox Rules needs to be checked manually for any Delegate Rules. --"
Write-Host -ForegroundColor Red "Warning: Multiple rules have been found on this resource mailbox. Only the Default Junk Mail rule is expected. Depending on the rules setup, this may block RBA functionality."
Write-Host -ForegroundColor Red "Warning: Please remove the rule(s) via Remove-InboxRule cmdlet and re-run this script."
}
} else {
Write-Host -ForegroundColor Green "Delegate Rules check passes."
Expand All @@ -106,6 +117,7 @@ function GetCalendarProcessing {
Make sure you Import-Module ExchangeOnlineManagement
and Connect-ExchangeOnline
Exiting script."
Stop-Transcript
exit
}

Expand All @@ -124,6 +136,7 @@ function EvaluateCalProcessing {
Write-Host -ForegroundColor Red "Error: AutomateProcessing is set to $($RbaSettings.AutomateProcessing)."
Write-Host -ForegroundColor Yellow "Use 'Set-CalendarProcessing -Identity $Identity -AutomateProcessing AutoAccept' to set AutomateProcessing to AutoAccept."
Write-Host -ForegroundColor Red "Exiting script."
Stop-Transcript
exit
} else {
Write-Host -ForegroundColor Green "AutomateProcessing is set to AutoAccept. RBA will analyze the meeting request."
Expand Down Expand Up @@ -254,10 +267,23 @@ function RBAProcessingValidation {
Write-Host "`t RequestInPolicy: {$($RbaSettings.RequestInPolicy)}"
Write-Host "`t AllRequestInPolicy: "$RbaSettings.AllRequestInPolicy
Write-Host -ForegroundColor Red "Exiting script."
Stop-Transcript
exit
}
}

# Write out a list of Mailboxes
function OutputMBList {
param (
[Parameter(Mandatory)]
[string[]]$MBList
)
foreach ($User in $MBList) {
$User = Get-Mailbox -Identity $User
Write-Host " `t `t [$($User.DisplayName)] -- $($User.PrimarySmtpAddress)"
}
}

function InPolicyProcessing {
# In-policy request processing
Write-DashLineBoxColor @(" In-Policy request processing:") -Color Yellow
Expand All @@ -266,7 +292,7 @@ function InPolicyProcessing {
Write-Host "`t BookInPolicy: {$($RbaSettings.BookInPolicy)}"
} else {
Write-Host "`t BookInPolicy: These $($RbaSettings.BookInPolicy.count) accounts do not require the delegate approval."
foreach ($BIPUser in $RbaSettings.BookInPolicy) { Write-Host " `t `t $BIPUser " }
OutputMBList($RbaSettings.BookInPolicy)
}
Write-Host "`t AllBookInPolicy: "$RbaSettings.AllBookInPolicy
Write-Host "`t RequestInPolicy: {$($RbaSettings.RequestInPolicy)}"
Expand All @@ -279,7 +305,7 @@ function InPolicyProcessing {
} else {
if ($RbaSettings.BookInPolicy.Count -gt 0) {
Write-Host "- The RBA will process (auto-book / accept) in-policy requests from this list of Users:"
foreach ($BIPUser in $RbaSettings.BookInPolicy) { Write-Host " `t `t $BIPUser" }
OutputMBList($RbaSettings.BookInPolicy)
}

Write-Host "- RBA will forward all in-policy meetings to the resource delegates."
Expand All @@ -297,7 +323,7 @@ function OutOfPolicyProcessing {
Write-DashLineBoxColor @(" Out-of-Policy request processing:") -Color DarkYellow
if ($RbaSettings.RequestOutOfPolicy.Count -gt 0) {
Write-Host "`t RequestOutOfPolicy: These {$($RbaSettings.RequestOutOfPolicy.Count)} accounts are allowed to submit out-of-policy requests (that require approval by a resource delegate)."
foreach ($OutOfPolicyUser in $RbaSettings.RequestOutOfPolicy) { Write-Host "`t `t $OutOfPolicyUser" }
OutputMBList($RbaSettings.RequestOutOfPolicy)
} else {
Write-Host "`t RequestOutOfPolicy: {$($RbaSettings.RequestOutOfPolicy)}"
}
Expand All @@ -307,7 +333,7 @@ function OutOfPolicyProcessing {
Write-Host -ForegroundColor Yellow "Information: - All users are allowed to submit out-of-policy requests to the resource mailbox. Out-of-policy requests require approval by a resource mailbox delegate."

if ($RbaSettings.RequestOutOfPolicy.count -gt 0) {
Write-Host -ForegroundColor Red "Warning: The users that are listed in RequestOutOfPolicy are overridden by the AllRequestOutOfPolicy as everyone can submit out of policy requests."
Write-Host -ForegroundColor Magenta "Warning: The users that are listed in RequestOutOfPolicy are overridden by the AllRequestOutOfPolicy as everyone can submit out of policy requests."
}
} else {
if ($RbaSettings.RequestOutOfPolicy.count -eq 0) {
Expand All @@ -326,7 +352,7 @@ function RBADelegateSettings {
Write-Host "`t ResourceDelegates: "$RbaSettings.ResourceDelegates
} else {
Write-Host "`t ResourceDelegates: $($RbaSettings.ResourceDelegates.Count) Resource Delegate`(s`) have been configured."
foreach ($RDUser in $RbaSettings.ResourceDelegates) { Write-Host " `t `t $RDUser" }
OutputMBList($RbaSettings.ResourceDelegates)
}

Write-Host "`t AddNewRequestsTentatively: "$RbaSettings.AddNewRequestsTentatively
Expand All @@ -346,15 +372,15 @@ function RBADelegateSettings {
Write-Host -ForegroundColor White "Information: Delegate(s) will not receive any In Policy requests as they will be AutoApproved."
} elseif ($RbaSettings.BookInPolicy.Count -gt 0 ) {
Write-Host -ForegroundColor White "Information: Delegate(s) will not receive requests from users in the BookInPolicy as they will be AutoApproved."
foreach ($BIPUser in $RbaSettings.BookInPolicy) { Write-Host -ForegroundColor Yellow " `t `t $BIPUser " }
OutputMBList($RbaSettings.BookInPolicy)
}

if ($RbaSettings.AllRequestOutOfPolicy -eq $false) {
if ($RbaSettings.RequestOutOfPolicy.Count -eq 0 ) {
Write-Host -ForegroundColor Yellow "Warning: Delegate(s) will not receive any Out of Policy requests as they will all be AutoDenied."
} else {
Write-Host -ForegroundColor Yellow "Warning: Delegate(s) will only receive any Out of Policy requests from the below list of users."
foreach ($OutOfPolicyUser in $RbaSettings.RequestOutOfPolicy) { Write-Host "`t `t $OutOfPolicyUser" }
OutputMBList($RbaSettings.RequestOutOfPolicy)
}
} else {
Write-Host -ForegroundColor Yellow "Warning: All users can send Out of Policy requests to be approved by the Resource Delegates."
Expand Down Expand Up @@ -496,7 +522,7 @@ function RBAPostScript {
function RBALogSummary {
Write-DashLineBoxColor @("RBA Log Summary") -Color Blue -DashChar =

$RBALog = (Export-MailboxDiagnosticLogs $Identity -ComponentName RBA).MailboxLog -split "`\n"
$RBALog = ((Export-MailboxDiagnosticLogs $Identity -ComponentName RBA).MailboxLog -split "`\n`\r").Trim()

Write-Host "`tFound $($RBALog.count) RBA Log entries in RBALog. Summarizing Accepts, Declines, and Tentative meetings."

Expand Down Expand Up @@ -651,7 +677,7 @@ function ValidateRoomListSettings {
foreach ($prop in $requiredProperties) {
if ([string]::IsNullOrEmpty($script:Place.$prop)) {
$requiredPropertiesMissing = $true
Write-Host -ForegroundColor Red "`tError: Required Property '$prop' is not set for $Identity."
Write-Host -ForegroundColor Magenta "`tWarning: Required Property '$prop' is not set for $Identity. RoomList functionality may not work as expected."
} else {
Write-Host -ForegroundColor Green "`tRequired Property '$prop' is set to $($script:Place.$prop)."
}
Expand Down Expand Up @@ -731,3 +757,4 @@ RBAPostProcessing
VerbosePostProcessing
RBALogSummary
RBAPostScript
Stop-Transcript
30 changes: 18 additions & 12 deletions docs/Calendar/Check-SharingStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ Download the latest release: [Check-SharingStatus.ps1](https://github.com/micros

This script runs a variety of PowerShell cmdlets to validate the sharing relationship between two users.

Terminology:
Owner - this is the mailbox that owns the Calendar being shared.
Receiver - this is the mailbox 'viewing' the owner calendar.
### Terminology:
- **Owner** - this is the mailbox that owns the Calendar being shared.
- **Receiver** - this is the mailbox 'viewing' the owner calendar.

First item is to determine what kind of sharing relationship the users have.
Modern Sharing (New Model Sharing) - Recipient gets a replicated copy of the Owners Calendar in their MB
Old Model Sharing – Recipient is granted rights but have so connect to the Owners server to get Calendar information.
External Sharing – Can be New or Old Model sharing, but outside of the Exchange Online Tenant / Organization.
Publishing – Owner publishes a link to their calendar, which clients can pull.
Sample Execution:
```PowerShell
Check-SharingStatus.ps1 -Owner [email protected] -Receiver [email protected]
```

Next you need to determine if the relationship is healthy.
Look at the logs and output included in the script.
## General Overview of looking at Sharing Issues:
1. The first thing to determine is what kind of sharing relationship the users have.
- **Modern Sharing** (New Model Sharing / REST) - Recipient gets a replicated copy of the Owners Calendar in their Mailbox.
- **Old Model Sharing** – Recipient is granted rights but has to connect to the Owners server to get Calendar information.
- **External Sharing** – Can be New or Old Model sharing, but outside of the Exchange Online Tenant / Organization.
- **Publishing** (ICS) – Owner publishes a link to their calendar, which clients can pull.
2. Next you need to determine if the relationship is healthy.
Look at the output from the script.

Last you need to look at how it is working. Generally, you will get Calendar Logs from Owner and Receiver for a copied meeting and check replication times, etc.
See [CalLogSummaryScript](https://github.com/microsoft/CSS-Exchange/releases/latest/download/Get-CalendarDiagnosticObjectsSummary.ps1)
3. Last, you need to look at how it is working.
Generally, you will get Calendar Logs from Owner and Receiver for a copied meeting and check replication times, etc.
- See [CalLogSummaryScript](https://github.com/microsoft/CSS-Exchange/releases/latest/download/Get-CalendarDiagnosticObjectsSummary.ps1) for collecting CalLogs.
5 changes: 3 additions & 2 deletions docs/Calendar/Get-CalendarDiagnosticObjectsSummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Download the latest release: [Get-CalendarDiagnosticObjectsSummary.ps1](https://
This script runs the Get-CalendarDiagnosticObjects script and returns a summarized timeline of actions into clear english.
To run the script, you will need a valid SMTP Address for a user and a meeting Subject or MeetingID.

The script will display summarized timeline of actions and save the logs returned into a csv file in current directory.
The script will display summarized timeline of actions and save the logs returned is csv format in the current directory.


Syntax:
#### Syntax:

Example to return timeline for a user with MeetingID
```PowerShell
Expand All @@ -21,3 +21,4 @@ Example to return timeline for a user with Subject
```PowerShell
.\Get-CalendarDiagnosticObjectsSummary.ps1 -Identity [email protected] -Subject Test_OneTime_Meeting_Subject
```

5 changes: 3 additions & 2 deletions docs/Calendar/Get-RBASummary.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This script runs the Get-CalendarProcessing cmdlet and returns the output with m
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:
#### Syntax:

Example to display the setting of room mailbox.
```PowerShell
Expand All @@ -17,7 +17,7 @@ Example to display the setting of room mailbox.
.\Get-RBASummary.ps1 -Identity Room1 -Verbose
```

High-level steps for RBA processing: <br>
##### High-level steps for RBA processing: <br>

1. Determine if the Meeting Request is in policy or out of policy.<br>
2. If the meeting request is Out of Policy, see if the user has rights to create an Out of Policy request and if so, forward it to the Delegates.<br>
Expand All @@ -30,3 +30,4 @@ When the RBA receives a Meeting Request, the first thing that it will do is to d
Whether the meeting is in or out of policy, the RBA will look up the configuration that will tell it what to do with the meeting. By default, all out of policy meetings are rejected, and all in policy meetings are accepted, but there is a larger range of customization that you can do to get the RBA to treat this resource the way you want it to.

If the meeting is accepted, the RBA will Post Process it based on the Post Processing configuration.

0 comments on commit 4ff2634

Please sign in to comment.