Skip to content

Commit c0cbd88

Browse files
authored
Merge pull request #8 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 697ee60 + f94ce24 commit c0cbd88

File tree

8 files changed

+84
-12
lines changed

8 files changed

+84
-12
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
function Get-CIPPAlertAppCertificateExpiry {
2+
<#
3+
.FUNCTIONALITY
4+
Entrypoint
5+
#>
6+
[CmdletBinding()]
7+
Param (
8+
[Parameter(Mandatory = $false)]
9+
[Alias('input')]
10+
$InputValue,
11+
$TenantFilter
12+
)
13+
14+
try {
15+
Write-Host "Checking app expire for $($TenantFilter)"
16+
$appList = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/applications?`$select=appId,displayName,keyCredentials" -tenantid $TenantFilter
17+
} catch {
18+
return
19+
}
20+
21+
$AlertData = foreach ($App in $applist) {
22+
Write-Host "checking $($App.displayName)"
23+
if ($App.keyCredentials) {
24+
foreach ($Credential in $App.keyCredentials) {
25+
if ($Credential.endDateTime -lt (Get-Date).AddDays(30) -and $Credential.endDateTime -gt (Get-Date).AddDays(-7)) {
26+
Write-Host ("Application '{0}' has certificates expiring on {1}" -f $App.displayName, $Credential.endDateTime)
27+
@{ DisplayName = $App.displayName; Expires = $Credential.endDateTime }
28+
}
29+
}
30+
}
31+
}
32+
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
33+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
function Get-CIPPAlertAppleTerms {
2+
<#
3+
.FUNCTIONALITY
4+
Entrypoint
5+
#>
6+
[CmdletBinding()]
7+
Param (
8+
[Parameter(Mandatory = $false)]
9+
[Alias('input')]
10+
$InputValue,
11+
$TenantFilter
12+
)
13+
14+
# 0 = Expired
15+
# 1 = expired?
16+
# 2 = unknown
17+
# 3 = Terms & Conditions
18+
# 4 = Warning
19+
20+
try {
21+
$appleterms = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/deviceManagement/depOnboardingSettings" -tenantid $TenantFilter
22+
} catch {
23+
return
24+
}
25+
26+
if ($appleterms.lastSyncErrorCode -eq 3) {
27+
$AlertData = "New Apple Business Manager terms are ready to accept."
28+
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
29+
}
30+
}

Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Webhooks/Push-AuditLogTenant.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ function Push-AuditLogTenant {
2626
}
2727
$CIPPURL = $LegacyUrl
2828
} else {
29-
$CIPPURL = 'https://{0}' -f $CippConfig.Value
29+
if (!$CippConfig) {
30+
$CippConfig = @{
31+
PartitionKey = 'InstanceProperties'
32+
RowKey = 'CIPPURL'
33+
Value = [string]([System.Uri]$Request.Headers.'x-ms-original-url').Host
34+
}
35+
Add-AzDataTableEntity @ConfigTable -Entity $CippConfig -Force
36+
$CIPPURL = 'https://{0}' -f $CippConfig.Value
37+
} else { $CIPPURL = 'https://{0}' -f $CippConfig.Value }
3038
}
3139

3240
# Get webhook rules

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Identity/Administration/Groups/Invoke-AddGroupTemplate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Function Invoke-AddGroupTemplate {
2020
Displayname = $request.body.displayname
2121
Description = $request.body.description
2222
groupType = $request.body.groupType
23-
MembershipRules = $request.body.membershipRule
23+
MembershipRules = $request.body.membershipRules
2424
allowExternal = $request.body.allowExternal
2525
username = $request.body.username
2626
GUID = $GUID

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Conditional/Invoke-ExecNamedLocation.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Function Invoke-ExecNamedLocation {
1717
# Write to the Azure Functions log stream.
1818
Write-Host 'PowerShell HTTP trigger function processed a request.'
1919

20-
$TenantFilter = $Request.Body.TenantFilter
21-
$NamedLocationId = $Request.Body.NamedLocationId
22-
$change = $Request.Body.change
23-
$content = $Request.Body.input
20+
$TenantFilter = $Request.Body.TenantFilter ?? $Request.Query.TenantFilter
21+
$NamedLocationId = $Request.Body.NamedLocationId ?? $Request.Query.NamedLocationId
22+
$change = $Request.Body.change ?? $Request.Query.change
23+
$content = $Request.Body.input ?? $Request.Query.input
2424

2525
try {
2626
$results = Set-CIPPNamedLocation -NamedLocationId $NamedLocationId -TenantFilter $TenantFilter -change $change -content $content -ExecutingUser $request.headers.'x-ms-client-principal'

Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@ function Invoke-CIPPOffboardingJob {
3535
Set-CIPPSignInState -TenantFilter $tenantFilter -userid $username -AccountEnabled $false -ExecutingUser $ExecutingUser -APIName $APIName
3636
}
3737

38-
{ $_.'OnedriveAccess' -ne '' } {
38+
{ $_.'OnedriveAccess' } {
3939
$Options.OnedriveAccess | ForEach-Object { Set-CIPPSharePointPerms -tenantFilter $tenantFilter -userid $username -OnedriveAccessUser $_.value -ExecutingUser $ExecutingUser -APIName $APIName }
4040
}
4141

42-
{ $_.'AccessNoAutomap' -ne '' } {
42+
{ $_.'AccessNoAutomap' } {
4343
$Options.AccessNoAutomap | ForEach-Object { Set-CIPPMailboxAccess -tenantFilter $tenantFilter -userid $username -AccessUser $_.value -Automap $false -AccessRights @('FullAccess') -ExecutingUser $ExecutingUser -APIName $APIName }
4444
}
45-
{ $_.'AccessAutomap' -ne '' } {
45+
{ $_.'AccessAutomap' } {
4646
$Options.AccessAutomap | ForEach-Object { Set-CIPPMailboxAccess -tenantFilter $tenantFilter -userid $username -AccessUser $_.value -Automap $true -AccessRights @('FullAccess') -ExecutingUser $ExecutingUser -APIName $APIName }
4747
}
4848

49-
{ $_.'OOO' -ne '' } {
49+
{ $_.'OOO' } {
5050
Set-CIPPOutOfOffice -tenantFilter $tenantFilter -userid $username -InternalMessage $Options.OOO -ExternalMessage $Options.OOO -ExecutingUser $ExecutingUser -APIName $APIName -state 'Enabled'
5151
}
52-
{ $_.'forward' -ne '' } {
52+
{ $_.'forward' } {
5353
if (!$Options.keepCopy) {
5454
Set-CIPPForwarding -userid $userid -username $username -tenantFilter $Tenantfilter -Forward $Options.forward.value -ExecutingUser $ExecutingUser -APIName $APIName
5555
} else {

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardcalDefault.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function Invoke-CIPPStandardcalDefault {
3333
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'calDefault'
3434

3535
# Input validation
36+
$Settings.permissionlevel = $Settings.permissionlevel.value ? $Settings.permissionlevel.value : $Settings.permissionlevel
3637
if ([string]::IsNullOrWhiteSpace($Settings.permissionlevel) -or $Settings.permissionlevel -eq 'Select a value') {
3738
Write-LogMessage -API 'Standards' -tenant $tenant -message 'calDefault: Invalid permissionlevel parameter set' -sev Error
3839
Return

version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.4
1+
7.0.5

0 commit comments

Comments
 (0)