forked from KelvinTegelaar/CIPP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'KelvinTegelaar:master' into master
- Loading branch information
Showing
11 changed files
with
152 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
Modules/CIPPCore/Public/Entrypoints/Invoke-ListRoomLists.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using namespace System.Net | ||
|
||
Function Invoke-ListRoomLists { | ||
<# | ||
.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 | ||
|
||
try { | ||
$params = @{ | ||
uri = 'https://graph.microsoft.com/beta/places/microsoft.graph.roomlist' | ||
tenantid = $TenantFilter | ||
AsApp = $true | ||
} | ||
$GraphRequest = New-GraphGetRequest @params | ||
|
||
$StatusCode = [HttpStatusCode]::OK | ||
} catch { | ||
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message | ||
$StatusCode = [HttpStatusCode]::Forbidden | ||
$GraphRequest = $ErrorMessage | ||
} | ||
# Associate values to output bindings by calling 'Push-OutputBinding'. | ||
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ | ||
StatusCode = $StatusCode | ||
Body = @($GraphRequest | Sort-Object displayName) | ||
}) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using namespace System.Net | ||
|
||
Function Invoke-ListRooms { | ||
<# | ||
.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 | ||
|
||
try { | ||
$params = @{ | ||
uri = 'https://graph.microsoft.com/beta/places/microsoft.graph.room' | ||
tenantid = $TenantFilter | ||
AsApp = $true | ||
} | ||
$GraphRequest = New-GraphGetRequest @params | ||
|
||
$StatusCode = [HttpStatusCode]::OK | ||
} catch { | ||
$ErrorMessage = Get-NormalizedError -Message $_.Exception.Message | ||
$StatusCode = [HttpStatusCode]::Forbidden | ||
$GraphRequest = $ErrorMessage | ||
} | ||
# Associate values to output bindings by calling 'Push-OutputBinding'. | ||
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ | ||
StatusCode = $StatusCode | ||
Body = @($GraphRequest | Sort-Object displayName) | ||
}) | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
Modules/CIPPCore/Public/Entrypoints/Invoke-ListTenantAllowBlockList.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.6.0 | ||
5.6.2 |