CriticalSolutionsNetwork / M365FoundationsCISReport

Automated assessment of 51 CIS 365 Foundations v3.0.0 benchmark safeguards.
https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/
Other
4 stars 1 forks source link

Rec: 1.3.3 - Validate Test-ExternalSharingCalendars.ps1, ELevel: E3, ProfileLevel: L2, IG1: FALSE, IG2: TRUE, IG3: TRUE, Connection: EXO #62

Closed DrIOSX closed 1 month ago

DrIOSX commented 2 months ago

Validation for Test-ExternalSharingCalendars.ps1

Recommendation Details

Test-ExternalSharingCalendars.ps1

Tasks

Validate recommendation details

Validate test for a pass

Validate test for a fail

Add notes and observations

If needed, the helpers folder in .\source\helpers contains a CSV to assist with locating the test definition.

DrIOSX commented 2 months ago

Base PowerShell Audit:

Get-SharingPolicy | Where-Object { $_.Domains -like '*CalendarSharing*' }
DrIOSX commented 2 months ago

Audit Mailboxes prior to disabling the feature globally:

$mailboxes = Get-Mailbox -ResultSize Unlimited 
foreach ($mailbox in $mailboxes) { 
    # Get the name of the default calendar folder (depends on the mailbox's language)
    $calendarFolder = string.Name 
    # Get users calendar folder settings for their default Calendar folder 
    # calendar has the format identity:\<calendar folder name>
    $calendar = Get-MailboxCalendarFolder -Identity "$($mailbox.PrimarySmtpAddress):\$calendarFolder" 
    if ($calendar.PublishEnabled) { 
        Write-Host -ForegroundColor Yellow "Calendar publishing is enabled for $($mailbox.PrimarySmtpAddress) on $($calendar.PublishedCalendarUrl)"
    }
}