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