Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#775 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Dev to HF
  • Loading branch information
KelvinTegelaar authored Apr 29, 2024
2 parents 2effb36 + f142a81 commit 1944370
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Function Invoke-ListCalendarPermissions {

try {
$GetCalParam = @{Identity = $UserID; FolderScope = 'Calendar' }
$CalendarFolder = New-ExoRequest -tenantid $Tenantfilter -cmdlet 'Get-MailboxFolderStatistics' -cmdParams $GetCalParam -UseSystemMailbox $true | Select-Object -First 1
$CalendarFolder = New-ExoRequest -tenantid $Tenantfilter -cmdlet 'Get-MailboxFolderStatistics' -cmdParams $GetCalParam | Select-Object -First 1
$CalParam = @{Identity = "$($UserID):\$($CalendarFolder.name)" }
$GraphRequest = New-ExoRequest -tenantid $Tenantfilter -cmdlet 'Get-MailboxFolderPermission' -cmdParams $CalParam -UseSystemMailbox $true | Select-Object Identity, User, AccessRights, FolderName
Write-LogMessage -API 'List Calendar Permissions' -tenant $tenantfilter -message "Calendar permissions listed for $($tenantfilter)" -sev Debug
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using namespace System.Net

Function Invoke-ListTenantAllowBlockList {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
param($Request, $TriggerMetadata)

$APIName = $TriggerMetadata.FunctionName
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'


# Write to the Azure Functions log stream.
Write-Host 'PowerShell HTTP trigger function processed a request.'

# Interact with query parameters or the body of the request.
$TenantFilter = $Request.Query.TenantFilter
$ListTypes = 'Sender','Url','FileHash'
try {
$Request = ForEach ($_ in $ListTypes) {
@{
CmdletInput = @{
CmdletName = 'Get-TenantAllowBlockListItems'
Parameters = @{ListType = $_ }
}
}
}
$BatchResults = New-ExoBulkRequest -tenantid $TenantFilter -cmdletArray $Request

$StatusCode = [HttpStatusCode]::OK
} catch {
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message
$StatusCode = [HttpStatusCode]::Forbidden
$BatchResults = $ErrorMessage
}
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = $StatusCode
Body = @($BatchResults)
})
}
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.0
5.6.1

0 comments on commit 1944370

Please sign in to comment.