Skip to content

Commit

Permalink
Merge pull request #44 from KelvinTegelaar/master
Browse files Browse the repository at this point in the history
[pull] master from KelvinTegelaar:master
  • Loading branch information
pull[bot] authored Aug 13, 2024
2 parents 3e3de53 + dc4b4ff commit bf73702
Show file tree
Hide file tree
Showing 28 changed files with 106 additions and 224 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cippz6s4d
name: Build and deploy Powershell project to Azure Function App - cipp4i6t3

on:
push:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cippz6s4d'
app-name: 'cipp4i6t3'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D27E7CF0887F4E4591F3957CCA96F0FD }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_9D257A31ACA24925A112AF5FFC2BEAFE }}
30 changes: 0 additions & 30 deletions .github/workflows/dev_cipphfjdq.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cippacnqv
name: Build and deploy Powershell project to Azure Function App - cippkwn4s

on:
push:
Expand All @@ -23,17 +23,17 @@ jobs:
uses: actions/checkout@v4

- name: Login to Azure
uses: azure/login@v1
uses: azure/login@v2
with:
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_6085081ED1124B799258E9FF743FF4B9 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_9BDB2DDBFAFA4BC19C20A58B204BFAF3 }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_02B5224812794971B05EDD557AF2B867 }}
client-id: ${{ secrets.AZUREAPPSERVICE_CLIENTID_B6BCC8886F40482FB8B43907FCDA6596 }}
tenant-id: ${{ secrets.AZUREAPPSERVICE_TENANTID_0D1C65B9099F48FABDF7F7052EA6887F }}
subscription-id: ${{ secrets.AZUREAPPSERVICE_SUBSCRIPTIONID_76518AE5ECB34375A414DEEE1119C161 }}

- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cippacnqv'
app-name: 'cippkwn4s'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Powershell project to Azure Function App - cippckdtz
name: Build and deploy Powershell project to Azure Function App - cipplwwww

on:
push:
Expand All @@ -24,7 +24,7 @@ jobs:
uses: Azure/functions-action@v1
id: fa
with:
app-name: 'cippckdtz'
app-name: 'cipplwwww'
slot-name: 'Production'
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_726578DA8A7243BF9D82FE123C2F6E7F }}
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_00A9A6DFE9244C2EA8952190FFF10F45 }}
30 changes: 0 additions & 30 deletions .github/workflows/dev_cippopy3o.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/dev_cipppwrro.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/ninjaone_cipp426ns.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Config/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@
"value": "none"
},
{
"label": "Restirct sharing to specific domains",
"label": "Restrict sharing to specific domains",
"value": "allowList"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Function Invoke-ExecStandardsRun {
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'
$tenantfilter = if ($Request.Query.TenantFilter) { $Request.Query.TenantFilter } else { 'allTenants' }
try {
$null = Invoke-CIPPStandardsRun -Tenantfilter $tenantfilter
$null = Invoke-CIPPStandardsRun -Tenantfilter $tenantfilter -Force
$Results = "Successfully Started Standards Run for Tenant $tenantfilter"
} catch {
$Results = "Failed to start standards run for $tenantfilter. Error: $($_.Exception.Message)"
Expand Down
35 changes: 6 additions & 29 deletions Modules/CIPPCore/Public/Entrypoints/Invoke-PublicPhishingCheck.ps1

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions Modules/CIPPCore/Public/Invoke-CIPPStandardsRun.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ function Invoke-CIPPStandardsRun {
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[string]$TenantFilter = 'allTenants'
[string]$TenantFilter = 'allTenants',
[switch]$Force
)
Write-Host "Starting process for standards - $($tenantFilter)"

$AllTasks = Get-CIPPStandards -TenantFilter $TenantFilter

if ($Force.IsPresent) {
Write-Host 'Clearing Rerun Cache'
foreach ($Task in $AllTasks) {
$null = Test-CIPPRerun -Type Standard -Tenant $Task.Tenant -Settings @{} -API $Task.Standard
}
}

#For each item in our object, run the queue.
$Queue = New-CippQueueEntry -Name "Applying Standards ($TenantFilter)" -TotalTasks ($AllTasks | Measure-Object).Count

Expand All @@ -26,4 +34,4 @@ function Invoke-CIPPStandardsRun {
$InstanceId = Start-NewOrchestration -FunctionName 'CIPPOrchestrator' -InputObject ($InputObject | ConvertTo-Json -Depth 5 -Compress)
Write-Host "Started orchestration with ID = '$InstanceId'"
#$Orchestrator = New-OrchestrationCheckStatusResponse -Request $Request -InstanceId $InstanceId
}
}
15 changes: 10 additions & 5 deletions Modules/CIPPCore/Public/Set-CIPPDefaultAPDeploymentProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,31 @@ function Set-CIPPDefaultAPDeploymentProfile {
}
if (!$Profiles) {
if ($PSCmdlet.ShouldProcess($displayName, 'Add Autopilot profile')) {
$Type = 'Add'
$GraphRequest = New-GraphPostRequest -uri 'https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeploymentProfiles' -body $body -tenantid $tenantfilter
Write-LogMessage -user $User -API $APIName -tenant $($tenantfilter) -message "Added Autopilot profile $($displayname)" -Sev 'Info'
}
} else {
#patch the profile
$Type = 'Edit'
$null = New-GraphPostRequest -uri "https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeploymentProfiles/$($Profiles.id)" -tenantid $tenantfilter -body $body -type PATCH
$GraphRequest = $Profiles
$GraphRequest = $Profiles | Select-Object -Last 1
}

if ($AssignTo -eq $true) {
$AssignBody = '{"target":{"@odata.type":"#microsoft.graph.allDevicesAssignmentTarget"}}'
if ($PSCmdlet.ShouldProcess($AssignTo, "Assign Autopilot profile $displayname")) {
$null = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeploymentProfiles/$($GraphRequest.id)/assignments" -tenantid $tenantfilter -type POST -body $AssignBody
#Get assignments
$Assignments = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeploymentProfiles/$($GraphRequest.id)/assignments" -tenantid $tenantfilter
if (!$Assignments) {
$null = New-GraphPOSTRequest -uri "https://graph.microsoft.com/beta/deviceManagement/windowsAutopilotDeploymentProfiles/$($GraphRequest.id)/assignments" -tenantid $tenantfilter -type POST -body $AssignBody
}
Write-LogMessage -user $User -API $APIName -tenant $($tenantfilter) -message "Assigned autopilot profile $($Displayname) to $AssignTo" -Sev 'Info'
}
}
"Successfully added profile for $($tenantfilter)"
"Successfully $($Type)ed profile for $($tenantfilter)"
} catch {
$ErrorMessage = Get-CippException -Exception $_
Write-LogMessage -user $User -API $APIName -tenant $($tenantfilter) -message "Failed adding Autopilot Profile $($Displayname). Error: $($ErrorMessage.NormalizedError)" -Sev 'Error' -LogData $ErrorMessage
Write-LogMessage -user $User -API $APIName -tenant $($tenantfilter) -message "Failed $($Type)ing Autopilot Profile $($Displayname). Error: $($ErrorMessage.NormalizedError)" -Sev 'Error' -LogData $ErrorMessage
throw "Failed to add profile for $($tenantfilter): $($ErrorMessage.NormalizedError)"
}
}
Loading

0 comments on commit bf73702

Please sign in to comment.