Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function Get-CIPPAlertAppCertificateExpiry {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
)

try {
Write-Host "Checking app expire for $($TenantFilter)"
$appList = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/applications?`$select=appId,displayName,keyCredentials" -tenantid $TenantFilter
} catch {
return
}

$AlertData = foreach ($App in $applist) {
Write-Host "checking $($App.displayName)"
if ($App.keyCredentials) {
foreach ($Credential in $App.keyCredentials) {
if ($Credential.endDateTime -lt (Get-Date).AddDays(30) -and $Credential.endDateTime -gt (Get-Date).AddDays(-7)) {
Write-Host ("Application '{0}' has certificates expiring on {1}" -f $App.displayName, $Credential.endDateTime)
@{ DisplayName = $App.displayName; Expires = $Credential.endDateTime }
}
}
}
}
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
}
30 changes: 30 additions & 0 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertAppleTerms.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
function Get-CIPPAlertAppleTerms {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
)

# 0 = Expired
# 1 = expired?
# 2 = unknown
# 3 = Terms & Conditions
# 4 = Warning

try {
$appleterms = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/deviceManagement/depOnboardingSettings" -tenantid $TenantFilter
} catch {
return
}

if ($appleterms.lastSyncErrorCode -eq 3) {
$AlertData = "New Apple Business Manager terms are ready to accept."
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ function Push-AuditLogTenant {
}
$CIPPURL = $LegacyUrl
} else {
$CIPPURL = 'https://{0}' -f $CippConfig.Value
if (!$CippConfig) {
$CippConfig = @{
PartitionKey = 'InstanceProperties'
RowKey = 'CIPPURL'
Value = [string]([System.Uri]$Request.Headers.'x-ms-original-url').Host
}
Add-AzDataTableEntity @ConfigTable -Entity $CippConfig -Force
$CIPPURL = 'https://{0}' -f $CippConfig.Value
} else { $CIPPURL = 'https://{0}' -f $CippConfig.Value }
}

# Get webhook rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Function Invoke-AddGroupTemplate {
Displayname = $request.body.displayname
Description = $request.body.description
groupType = $request.body.groupType
MembershipRules = $request.body.membershipRule
MembershipRules = $request.body.membershipRules
allowExternal = $request.body.allowExternal
username = $request.body.username
GUID = $GUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ Function Invoke-ExecNamedLocation {
# Write to the Azure Functions log stream.
Write-Host 'PowerShell HTTP trigger function processed a request.'

$TenantFilter = $Request.Body.TenantFilter
$NamedLocationId = $Request.Body.NamedLocationId
$change = $Request.Body.change
$content = $Request.Body.input
$TenantFilter = $Request.Body.TenantFilter ?? $Request.Query.TenantFilter
$NamedLocationId = $Request.Body.NamedLocationId ?? $Request.Query.NamedLocationId
$change = $Request.Body.change ?? $Request.Query.change
$content = $Request.Body.input ?? $Request.Query.input

try {
$results = Set-CIPPNamedLocation -NamedLocationId $NamedLocationId -TenantFilter $TenantFilter -change $change -content $content -ExecutingUser $request.headers.'x-ms-client-principal'
Expand Down
10 changes: 5 additions & 5 deletions Modules/CIPPCore/Public/Invoke-CIPPOffboardingJob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ function Invoke-CIPPOffboardingJob {
Set-CIPPSignInState -TenantFilter $tenantFilter -userid $username -AccountEnabled $false -ExecutingUser $ExecutingUser -APIName $APIName
}

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

{ $_.'AccessNoAutomap' -ne '' } {
{ $_.'AccessNoAutomap' } {
$Options.AccessNoAutomap | ForEach-Object { Set-CIPPMailboxAccess -tenantFilter $tenantFilter -userid $username -AccessUser $_.value -Automap $false -AccessRights @('FullAccess') -ExecutingUser $ExecutingUser -APIName $APIName }
}
{ $_.'AccessAutomap' -ne '' } {
{ $_.'AccessAutomap' } {
$Options.AccessAutomap | ForEach-Object { Set-CIPPMailboxAccess -tenantFilter $tenantFilter -userid $username -AccessUser $_.value -Automap $true -AccessRights @('FullAccess') -ExecutingUser $ExecutingUser -APIName $APIName }
}

{ $_.'OOO' -ne '' } {
{ $_.'OOO' } {
Set-CIPPOutOfOffice -tenantFilter $tenantFilter -userid $username -InternalMessage $Options.OOO -ExternalMessage $Options.OOO -ExecutingUser $ExecutingUser -APIName $APIName -state 'Enabled'
}
{ $_.'forward' -ne '' } {
{ $_.'forward' } {
if (!$Options.keepCopy) {
Set-CIPPForwarding -userid $userid -username $username -tenantFilter $Tenantfilter -Forward $Options.forward.value -ExecutingUser $ExecutingUser -APIName $APIName
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function Invoke-CIPPStandardcalDefault {
##$Rerun -Type Standard -Tenant $Tenant -Settings $Settings 'calDefault'

# Input validation
$Settings.permissionlevel = $Settings.permissionlevel.value ? $Settings.permissionlevel.value : $Settings.permissionlevel
if ([string]::IsNullOrWhiteSpace($Settings.permissionlevel) -or $Settings.permissionlevel -eq 'Select a value') {
Write-LogMessage -API 'Standards' -tenant $tenant -message 'calDefault: Invalid permissionlevel parameter set' -sev Error
Return
Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.4
7.0.5