Skip to content

Commit bde0b3f

Browse files
authored
Merge pull request #409 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 2f5dd6f + 68b9420 commit bde0b3f

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertVppTokenExpiry.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@ function Get-CIPPAlertVppTokenExpiry {
44
Entrypoint
55
#>
66
[CmdletBinding()]
7-
Param (
7+
param (
88
[Parameter(Mandatory = $false)]
99
[Alias('input')]
1010
$InputValue,
1111
$TenantFilter
1212
)
1313
try {
1414
try {
15-
$VppTokens = (New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/deviceAppManagement/vppTokens' -tenantid $TenantFilter).value
15+
$VppTokens = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/deviceAppManagement/vppTokens' -tenantid $TenantFilter
1616
$AlertData = foreach ($Vpp in $VppTokens) {
1717
if ($Vpp.state -ne 'valid') {
1818
$Message = 'Apple Volume Purchase Program Token is not valid, new token required'
1919
$Vpp | Select-Object -Property organizationName, appleId, vppTokenAccountType, @{Name = 'Message'; Expression = { $Message } }
20-
}
21-
if ($Vpp.expirationDateTime -lt (Get-Date).AddDays(30) -and $Vpp.expirationDateTime -gt (Get-Date).AddDays(-7)) {
20+
} elseif ($Vpp.expirationDateTime -lt (Get-Date).AddDays(30).ToUniversalTime() -and $Vpp.expirationDateTime -gt (Get-Date).AddDays(-7).ToUniversalTime()) {
2221
$Message = 'Apple Volume Purchase Program token expiring on {0}' -f $Vpp.expirationDateTime
2322
$Vpp | Select-Object -Property organizationName, appleId, vppTokenAccountType, @{Name = 'Message'; Expression = { $Message } }
2423
}

Modules/CIPPCore/Public/CippQueue/Invoke-ListCippQueue.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ function Invoke-ListCippQueue {
1515
$CippQueue = Get-CippTable -TableName 'CippQueue'
1616
$CippQueueTasks = Get-CippTable -TableName 'CippQueueTasks'
1717
$3HoursAgo = (Get-Date).ToUniversalTime().AddHours(-3).ToString('yyyy-MM-ddTHH:mm:ssZ')
18-
$CippQueueData = Get-CIPPAzDataTableEntity @CippQueue -Filter "Timestamp ge datetime'$3HoursAgo'" | Sort-Object -Property Timestamp -Descending
18+
$CippQueueData = Get-CIPPAzDataTableEntity @CippQueue -Filter "PartitionKey eq 'CippQueue' and Timestamp ge datetime'$3HoursAgo'" | Sort-Object -Property Timestamp -Descending
1919

2020
$QueueData = foreach ($Queue in $CippQueueData) {
21-
$Tasks = Get-CIPPAzDataTableEntity @CippQueueTasks -Filter "QueueId eq '$($Queue.RowKey)'" | Where-Object { $_.Name } | Select-Object @{n = 'Timestamp'; exp = { $_.Timestamp.DateTime.ToUniversalTime() } }, Name, Status
21+
$Tasks = Get-CIPPAzDataTableEntity @CippQueueTasks -Filter "PartitionKey eq 'Task' and QueueId eq '$($Queue.RowKey)'" | Where-Object { $_.Name } | Select-Object @{n = 'Timestamp'; exp = { $_.Timestamp.DateTime.ToUniversalTime() } }, Name, Status
2222
$TaskStatus = @{}
2323
$Tasks | Group-Object -Property Status | ForEach-Object {
2424
$TaskStatus.$($_.Name) = $_.Count

Modules/CIPPCore/Public/GraphHelper/Write-AlertTrace.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function Write-AlertTrace {
33
.FUNCTIONALITY
44
Internal function. Pleases most of Write-AlertTrace for alerting purposes
55
#>
6-
Param(
6+
param(
77
$cmdletName,
88
$data,
99
$tenantFilter
@@ -20,6 +20,8 @@ function Write-AlertTrace {
2020
$TableRow = @{
2121
'PartitionKey' = $PartitionKey
2222
'RowKey' = "$($tenantFilter)-$($cmdletName)"
23+
'CmdletName' = $cmdletName
24+
'Tenant' = $tenantFilter
2325
'LogData' = [string]$LogData
2426
}
2527
$Table.Entity = $TableRow
@@ -31,6 +33,8 @@ function Write-AlertTrace {
3133
$TableRow = @{
3234
'PartitionKey' = $PartitionKey
3335
'RowKey' = "$($tenantFilter)-$($cmdletName)"
36+
'CmdletName' = $cmdletName
37+
'Tenant' = $tenantFilter
3438
'LogData' = [string]$LogData
3539
}
3640
$Table.Entity = $TableRow

0 commit comments

Comments
 (0)