Skip to content

Commit

Permalink
Merge branch 'KelvinTegelaar:dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
BNWEIN authored Sep 26, 2023
2 parents 884e6bb + 7775609 commit ff92f5d
Show file tree
Hide file tree
Showing 37 changed files with 576 additions and 276 deletions.
14 changes: 6 additions & 8 deletions AddAlert/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
"methods": ["get", "post"]
},
{
"type": "http",
"direction": "out",
"name": "Response"
},
{
"name": "starter",
"direction": "in",
"type": "durableClient"
"type": "queue",
"direction": "out",
"name": "Subscription",
"queueName": "AlertSubscriptions"
}
]
}
}
11 changes: 4 additions & 7 deletions AddAlert/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ $Results = foreach ($Tenant in $tenants) {
try {
$TenantID = if ($tenant -ne 'AllTenants') {
(get-tenants | Where-Object -Property defaultDomainName -EQ $Tenant).customerId
}
else {
} else {
'AllTenants'
}
if ($Request.body.SetAlerts) {
Expand Down Expand Up @@ -58,11 +57,10 @@ $Results = foreach ($Tenant in $tenants) {
EventType = $eventType
ExecutingUser = $Request.headers.'x-ms-client-principal'
}
New-CIPPGraphSubscription @params
Push-OutputBinding -Name Subscription -Value $Params
}
}
}
else {
} else {
foreach ($eventType in $Request.body.EventTypes.value) {
$params = @{
TenantFilter = $tenant
Expand All @@ -78,8 +76,7 @@ $Results = foreach ($Tenant in $tenants) {
}
"Successfully added Alert for $($Tenant) to queue."
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $tenant -message "Successfully added Alert for $($Tenant) to queue." -Sev 'Info'
}
catch {
} catch {
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -tenant $tenant -message "Failed to add Alert for for $($Tenant) to queue" -Sev 'Error'
"Failed to add Alert for for $($Tenant) to queue $($_.Exception.message)"
}
Expand Down
12 changes: 12 additions & 0 deletions AddAlertSubscription_Queue/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scriptFile": "../Modules/CippEntryPoints/CippEntryPoints.psm1",
"entryPoint": "Receive-CippQueueTrigger",
"bindings": [
{
"name": "QueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "AlertSubscriptions"
}
]
}
75 changes: 37 additions & 38 deletions AddChocoApp/Choco.app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{

"displayName": "",
"installCommandLine": "",
"uninstallCommandLine": "",
Expand All @@ -11,47 +10,48 @@
"fileName": "IntunePackage.intunewin",
"@odata.type": "#microsoft.graph.win32LobApp",
"applicableArchitectures": "x86, x64",

"installExperience": {
"runAsAccount": "user",
"deviceRestartBehavior": "allow",
"@odata.type": "microsoft.graph.win32LobAppInstallExperience"
},
"detectionRules": [
{
"@odata.type": "#microsoft.graph.win32LobAppFileSystemDetection",
"path": "%programfiles%\\7-zip",
"fileOrFolderName": "7z.exe",
"check32BitOn64System": false,
"detectionType": "exists" }
"@odata.type": "#microsoft.graph.win32LobAppFileSystemDetection",
"path": "%programfiles%\\7-zip",
"fileOrFolderName": "7z.exe",
"check32BitOn64System": false,
"detectionType": "exists"
}
],
"returncode": [
{
"returnCode": 0,
"type": "success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1707,
"type": "Success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1641,
"type": "hardReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1618,
"type": "retry",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 3010,
"type": "softReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
}
],
"returncode": [
{
"returnCode": 0,
"type": "success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1707,
"type": "Success",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1641,
"type": "hardReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 1618,
"type": "retry",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
},
{
"returnCode": 3010,
"type": "softReboot",
"@odata.type": "#microsoft.graph.win32LobAppReturnCode"
}
],
"minimumNumberOfProcessors": "1",
"minimumFreeDiskSpaceInMB": "8",
"minimumCpuSpeedInMHz": "4",
Expand All @@ -60,7 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"


}
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/Immybot.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/automate.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/cwcommand.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/datto.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/huntress.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
3 changes: 2 additions & 1 deletion AddMSPApp/syncro.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,6 @@
"v10_1607": true
},
"notes": "CIPP Uploaded application",
"minimumMemoryInMB": "1"
"minimumMemoryInMB": "1",
"setupFilePath": "install.ps1"
}
36 changes: 18 additions & 18 deletions AddScheduledItems/function.json → AddScheduledItem/function.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "Response"
}
]
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "Response"
}
]
}
30 changes: 30 additions & 0 deletions AddScheduledItem/run.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using namespace System.Net
param($Request, $TriggerMetadata)
$APIName = $TriggerMetadata.FunctionName
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'
$task = $Request.Body
$Table = Get-CIPPTable -TableName 'ScheduledTasks'

$propertiesToCheck = @('Webhook', 'Email', 'PSA')
$PostExecution = ($propertiesToCheck | Where-Object { $task.PostExecution.$_ -eq $true }) -join ','
$Parameters = ($task.Parameters | ConvertTo-Json -Compress)
if ($Parameters -eq 'null') { $Parameters = '' }
$entity = @{
PartitionKey = [string]'ScheduledTask'
TaskState = [string]'Planned'
RowKey = [string]"$(New-Guid)"
Tenant = [string]$task.TenantFilter
Name = [string]$task.Name
Command = [string]$task.Command.value
Parameters = [string]$Parameters
ScheduledTime = [string]$task.ScheduledTime
Recurrence = [string]$task.Recurrence.value
PostExecution = [string]$PostExecution
Results = 'Planned'
}
Write-Host "entity: $($entity | ConvertTo-Json)"
Add-AzDataTableEntity @Table -Entity $entity
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = @{ Results = 'Task added successfully.' }
})
20 changes: 0 additions & 20 deletions AddScheduledItems/run.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions ExecBECRemediate/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ try {
$GraphRequest = New-GraphPostRequest -uri "https://graph.microsoft.com/v1.0/users/$SuspectUser" -tenantid $TenantFilter -type PATCH -body $passwordProfile -verbose
$GraphRequest = New-GraphPostRequest -uri "https://graph.microsoft.com/v1.0/users/$SuspectUser" -tenantid $TenantFilter -type PATCH -body '{"accountEnabled":"false"}' -verbose
$GraphRequest = New-GraphPostRequest -uri "https://graph.microsoft.com/v1.0/users/$SuspectUser/revokeSignInSessions" -tenantid $TenantFilter -type POST -body '{}' -verbose
$Mailboxes = New-ExoRequest -tenantid $TenantFilter -cmdlet "get-inboxrule" -cmdParams @{Mailbox = $SuspectUser } -anchor $SuspectUser | ForEach-Object {
New-ExoRequest -tenantid $TenantFilter -cmdlet "Disable-InboxRule" -cmdParams @{Confirm = $false; Identity = $_.Identity } -anchor $SuspectUser
$Mailboxes = New-ExoRequest -anchor $SuspectUser -tenantid $TenantFilter -cmdlet "get-inboxrule" -cmdParams @{Mailbox = $SuspectUser } | ForEach-Object {
New-ExoRequest -anchor $SuspectUser -tenantid $TenantFilter -cmdlet "Disable-InboxRule" -cmdParams @{Confirm = $false; Identity = $_.Identity }
}
$results = [pscustomobject]@{"Results" = "Executed Remediation for $SuspectUser and tenant $($TenantFilter). The temporary password is $password and must be changed at next logon." }
Write-LogMessage -API "BECRemediate" -tenant $tenantfilter -message "Executed Remediation for $SuspectUser" -sev "Info"
Expand Down
10 changes: 10 additions & 0 deletions ExecScheduledCommand/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"bindings": [
{
"name": "QueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "scheduledcommandprocessor"
}
]
}
Loading

0 comments on commit ff92f5d

Please sign in to comment.