fix: 1.3.3 simplified output and added object comment
This commit is contained in:
@@ -52,24 +52,72 @@ function Get-CISExoOutput {
|
||||
# Test-BlockSharedMailboxSignIn.ps1
|
||||
$MBX = Get-EXOMailbox -RecipientTypeDetails SharedMailbox
|
||||
# [object[]]
|
||||
# Example output:
|
||||
# 123e4567-e89b-12d3-a456-426614174000
|
||||
# 987e6543-21ba-12d3-a456-426614174000
|
||||
# abcddcba-98fe-76dc-a456-426614174000
|
||||
# $MBX example output:
|
||||
<#
|
||||
$MBX = @(
|
||||
[PSCustomObject]@{
|
||||
UserPrincipalName = "SMBuser1@domain.com"
|
||||
ExternalDirectoryObjectId = "123e4567-e89b-12d3-a456-426614174000"
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
UserPrincipalName = "SMBuser2@domain.com"
|
||||
ExternalDirectoryObjectId = "987e6543-21ba-12d3-a456-426614174000"
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
UserPrincipalName = "SMBuser3@domain.com"
|
||||
ExternalDirectoryObjectId = "abcddcba-98fe-76dc-a456-426614174000"
|
||||
}
|
||||
)
|
||||
#>
|
||||
return $MBX.ExternalDirectoryObjectId
|
||||
}
|
||||
'1.3.3' {
|
||||
# Test-ExternalSharingCalendars.ps1
|
||||
# Step: Retrieve sharing policies related to calendar sharing
|
||||
# $sharingPolicies Mock Object
|
||||
<#
|
||||
$sharingPolicies = [PSCustomObject]@{
|
||||
Name = "Default Sharing Policy"
|
||||
Domains = @("Anonymous:CalendarSharingFreeBusySimple")
|
||||
Enabled = $true
|
||||
Default = $true
|
||||
}
|
||||
#>
|
||||
$sharingPolicies = Get-SharingPolicy | Where-Object { $_.Domains -like '*CalendarSharing*' }
|
||||
# [psobject[]]
|
||||
return $sharingPolicies
|
||||
}
|
||||
'1.3.3b' {
|
||||
$mailboxes = Get-Mailbox -ResultSize Unlimited
|
||||
<#
|
||||
$mailboxes = @(
|
||||
[PSCustomObject]@{
|
||||
UserPrincipalName = "SMBuser1@domain.com"
|
||||
ExternalDirectoryObjectId = "123e4567-e89b-12d3-a456-426614174000"
|
||||
PrimarySmtpAddress = "SMBuser1@domain.com"
|
||||
PublishEnabled = $False
|
||||
PublishedCalendarUrl = "https://example.com/calendar/smbuser1"
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
UserPrincipalName = "SMBuser2@domain.com"
|
||||
ExternalDirectoryObjectId = "987e6543-21ba-12d3-a456-426614174000"
|
||||
PrimarySmtpAddress = "SMBuser2@domain.com"
|
||||
PublishEnabled = $False
|
||||
PublishedCalendarUrl = "https://example.com/calendar/smbuser2"
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
UserPrincipalName = "SMBuser3@domain.com"
|
||||
ExternalDirectoryObjectId = "abcddcba-98fe-76dc-a456-426614174000"
|
||||
PrimarySmtpAddress = "SMBuser3@domain.com"
|
||||
PublishEnabled = $False
|
||||
PublishedCalendarUrl = "https://example.com/calendar/smbuser3"
|
||||
}
|
||||
)
|
||||
#>
|
||||
$results = foreach ($mailbox in $mailboxes) {
|
||||
# Get the name of the default calendar folder (depends on the mailbox's language)
|
||||
$calendarFolder = [string](Get-ExoMailboxFolderStatistics $mailbox.PrimarySmtpAddress -FolderScope Calendar | Where-Object {$_.FolderType -eq 'Calendar'}).Name
|
||||
# Return single string Ex: return "Calendar" x 3 in array
|
||||
$calendarFolder = [string](Get-EXOMailboxFolderStatistics $mailbox.PrimarySmtpAddress -Folderscope Calendar | Where-Object { $_.FolderType -eq 'Calendar' }).Name
|
||||
Write-Verbose "Calendar folder for $($mailbox.PrimarySmtpAddress): $calendarFolder"
|
||||
# Get users calendar folder settings for their default Calendar folder
|
||||
# calendar has the format identity:\<calendar folder name>
|
||||
|
@@ -33,7 +33,7 @@ function Test-ExternalSharingCalendars {
|
||||
# Step: Retrieve sharing policies related to calendar sharing
|
||||
# $sharingPolicies Mock Object
|
||||
<#
|
||||
$mockPolicy = [PSCustomObject]@{
|
||||
$sharingPolicies = [PSCustomObject]@{
|
||||
Name = "Default Sharing Policy"
|
||||
Domains = @("Anonymous:CalendarSharingFreeBusySimple")
|
||||
Enabled = $true
|
||||
@@ -53,18 +53,18 @@ function Test-ExternalSharingCalendars {
|
||||
# Retrieve calendars with publishing enabled (from 1.3.3b)
|
||||
# $calendarDetails Mock Object
|
||||
<#
|
||||
$mailboxDetails = @(
|
||||
$calendarDetails = @(
|
||||
[PSCustomObject]@{
|
||||
Calendar = "user1@example.com"
|
||||
URL = "https://example.com/calendar/user1"
|
||||
Calendar = "SMBuser1@domain.com"
|
||||
URL = "https://example.com/calendar/smbuser1"
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Calendar = "user2@example.com"
|
||||
URL = "https://example.com/calendar/user2"
|
||||
Calendar = "SMBuser2@domain.com"
|
||||
URL = "https://example.com/calendar/smbuser2"
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Calendar = "user3@example.com"
|
||||
URL = "https://example.com/calendar/user3"
|
||||
Calendar = "SMBuser4@domain.com"
|
||||
URL = "https://example.com/calendar/smbuser3"
|
||||
}
|
||||
)
|
||||
#>
|
||||
|
Reference in New Issue
Block a user