diff --git a/Modules/CIPPCore/Public/Add-CIPPScheduledTask.ps1 b/Modules/CIPPCore/Public/Add-CIPPScheduledTask.ps1
index 8cd5b159d458..952e3a68bc93 100644
--- a/Modules/CIPPCore/Public/Add-CIPPScheduledTask.ps1
+++ b/Modules/CIPPCore/Public/Add-CIPPScheduledTask.ps1
@@ -54,5 +54,5 @@ function Add-CIPPScheduledTask {
} catch {
return "Could not add task: $($_.Exception.Message)"
}
- return 'Successfully added task'
+ return "Successfully added task: $($entity.Name)"
}
\ No newline at end of file
diff --git a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1 b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1
index 8321209ac94c..6013a2e05b7c 100644
--- a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1
+++ b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-ExecScheduledCommand.ps1
@@ -4,19 +4,19 @@ function Push-ExecScheduledCommand {
Entrypoint
#>
param($Item)
+ Write-Host "We are going to be running a scheduled task: $($Item.TaskInfo | ConvertTo-Json)"
$Table = Get-CippTable -tablename 'ScheduledTasks'
$task = $Item.TaskInfo
- $commandParameters = $Item.Parameters
+ $commandParameters = $Item.Parameters | ConvertTo-Json | ConvertFrom-Json -AsHashtable
$tenant = $Item.Parameters['TenantFilter']
- Write-Host 'started task'
+ Write-Host "Started Task: $($Item.Command) for tenant: $tenant"
try {
try {
- $results = & $Item.command @commandParameters
+ $results = & $Item.Command @commandParameters
} catch {
$results = "Task Failed: $($_.Exception.Message)"
-
}
Write-Host 'ran the command'
@@ -28,9 +28,13 @@ function Push-ExecScheduledCommand {
$results = $results | ForEach-Object { @{ Results = $_ } }
}
- $results = $results | Select-Object * -ExcludeProperty RowKey, PartitionKey
+ if ($results -is [string]) {
+ $StoredResults = $results
+ } else {
+ $results = $results | Select-Object * -ExcludeProperty RowKey, PartitionKey
+ $StoredResults = $results | ConvertTo-Json -Compress -Depth 20 | Out-String
+ }
- $StoredResults = $results | ConvertTo-Json -Compress -Depth 20 | Out-String
if ($StoredResults.Length -gt 64000 -or $task.Tenant -eq 'AllTenants') {
$StoredResults = @{ Results = 'The results for this query are too long to store in this table, or the query was meant for All Tenants. Please use the options to send the results to another target to be able to view the results. ' } | ConvertTo-Json -Compress
}
@@ -49,7 +53,7 @@ function Push-ExecScheduledCommand {
$TableDesign = ''
$HTML = ($results | Select-Object * -ExcludeProperty RowKey, PartitionKey | ConvertTo-Html -Fragment) -replace '
', "$TableDesign" | Out-String
- $title = "Scheduled Task $($task.Name) - $($task.ExpectedRunTime)"
+ $title = "Scheduled Task $($task.Name)"
Write-Host $title
switch -wildcard ($task.PostExecution) {
'*psa*' { Send-CIPPAlert -Type 'psa' -Title $title -HTMLContent $HTML }
@@ -84,5 +88,5 @@ function Push-ExecScheduledCommand {
ScheduledTime = "$nextRunUnixTime"
}
}
- Write-LogMessage -API 'Scheduler_UserTasks' -tenant $tenant -message "Successfully executed task: $($task.name)" -sev Info
+ Write-LogMessage -API 'Scheduler_UserTasks' -tenant $tenant -message "Successfully executed task: $($task.Name)" -sev Info
}
\ No newline at end of file
diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-RemoveScheduledItem.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-RemoveScheduledItem.ps1
index 414de1edb6e7..629760a2ca68 100644
--- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-RemoveScheduledItem.ps1
+++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Scheduler/Invoke-RemoveScheduledItem.ps1
@@ -12,13 +12,17 @@ Function Invoke-RemoveScheduledItem {
RowKey = $Request.Query.ID
PartitionKey = 'ScheduledTask'
}
+
+
$Table = Get-CIPPTable -TableName 'ScheduledTasks'
Remove-AzDataTableEntity @Table -Entity $task
+
+ Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Task removed: $($task.Name)" -Sev 'Info'
+
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = @{ Results = 'Task removed successfully.' }
})
- Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Task removed' -Sev 'Debug'
}
diff --git a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecNotificationConfig.ps1 b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecNotificationConfig.ps1
index 24df02441efd..f1f39d9bcc90 100644
--- a/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecNotificationConfig.ps1
+++ b/Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Settings/Invoke-ExecNotificationConfig.ps1
@@ -15,7 +15,7 @@ Function Invoke-ExecNotificationConfig {
# Write to the Azure Functions log stream.
Write-Host 'PowerShell HTTP trigger function processed a request.'
$sev = ([pscustomobject]$Request.body.Severity).value -join (',')
- $results = try {
+ $results = try {
$Table = Get-CIPPTable -TableName SchedulerConfig
$SchedulerConfig = @{
'tenant' = 'Any'
@@ -23,8 +23,8 @@ Function Invoke-ExecNotificationConfig {
'type' = 'CIPPNotifications'
'schedule' = 'Every 15 minutes'
'Severity' = [string]$sev
- 'email' = "$($Request.Body.Email)"
- 'webhook' = "$($Request.Body.Webhook)"
+ 'email' = "$($Request.Body.email)"
+ 'webhook' = "$($Request.Body.webhook)"
'onePerTenant' = [boolean]$Request.Body.onePerTenant
'sendtoIntegration' = [boolean]$Request.Body.sendtoIntegration
'includeTenantId' = [boolean]$Request.Body.includeTenantId
@@ -32,7 +32,7 @@ Function Invoke-ExecNotificationConfig {
'RowKey' = 'CippNotifications'
}
foreach ($logvalue in [pscustomobject]$Request.body.logsToInclude) {
- $SchedulerConfig[([pscustomobject]$logvalue.value)] = $true
+ $SchedulerConfig[([pscustomobject]$logvalue.value)] = $true
}
Add-CIPPAzDataTableEntity @Table -Entity $SchedulerConfig -Force | Out-Null
diff --git a/Modules/CIPPCore/Public/Entrypoints/Invoke-ListRoomLists.ps1 b/Modules/CIPPCore/Public/Entrypoints/Invoke-ListRoomLists.ps1
new file mode 100644
index 000000000000..74148522dec5
--- /dev/null
+++ b/Modules/CIPPCore/Public/Entrypoints/Invoke-ListRoomLists.ps1
@@ -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)
+ })
+
+}
diff --git a/Modules/CIPPCore/Public/Entrypoints/Invoke-ListRooms.ps1 b/Modules/CIPPCore/Public/Entrypoints/Invoke-ListRooms.ps1
new file mode 100644
index 000000000000..4e2f57124129
--- /dev/null
+++ b/Modules/CIPPCore/Public/Entrypoints/Invoke-ListRooms.ps1
@@ -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)
+ })
+
+}
diff --git a/Modules/CIPPCore/Public/Get-CIPPDomainAnalyser.ps1 b/Modules/CIPPCore/Public/Get-CIPPDomainAnalyser.ps1
index 33aa626e7c88..0bc50c4acaad 100644
--- a/Modules/CIPPCore/Public/Get-CIPPDomainAnalyser.ps1
+++ b/Modules/CIPPCore/Public/Get-CIPPDomainAnalyser.ps1
@@ -18,7 +18,7 @@ function Get-CIPPDomainAnalyser {
# Get all the things
- if ($TenantFilter -ne 'AllTenants') {
+ if ($TenantFilter -ne 'AllTenants' -and ![string]::IsNullOrEmpty($TenantFilter)) {
$DomainTable.Filter = "TenantGUID eq '{0}'" -f $TenantFilter
}
diff --git a/Modules/CIPPCore/Public/Set-CIPPSignInState.ps1 b/Modules/CIPPCore/Public/Set-CIPPSignInState.ps1
index 926d97aa90d6..ea26d3d309ed 100644
--- a/Modules/CIPPCore/Public/Set-CIPPSignInState.ps1
+++ b/Modules/CIPPCore/Public/Set-CIPPSignInState.ps1
@@ -7,10 +7,8 @@ function Set-CIPPSignInState {
$APIName = 'Disable User Sign-in',
$ExecutingUser
)
- 0
- try {
- if ($userid -like '*#EXT#*') { $userid = [System.Web.HttpUtility]::UrlEncode($userid) }
+ try {
$body = @{
accountEnabled = [bool]$AccountEnabled
} | ConvertTo-Json -Compress -Depth 1
@@ -22,3 +20,4 @@ function Set-CIPPSignInState {
return "Could not disable $userid. Error: $($_.Exception.Message)"
}
}
+
diff --git a/version_latest.txt b/version_latest.txt
index 566ac6388b64..d6a86bf436c0 100644
--- a/version_latest.txt
+++ b/version_latest.txt
@@ -1 +1 @@
-5.6.1
\ No newline at end of file
+5.6.2