Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bumping release to 1.7.0 #118

Merged
merged 34 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f3acd5f
ENHANCEMENT: Reduce reliance on PSSession imports
gavsto Feb 5, 2022
86d2b75
ADD: Azure AD Connect Endpoint API
gavsto Feb 5, 2022
12f5c56
Version update
gavsto Feb 5, 2022
b29a45c
Merge branch 'dev' into dev
gavsto Feb 5, 2022
9f9afc7
Merge pull request #113 from gavsto/dev
gavsto Feb 5, 2022
f17ae11
ENHANCEMENT: Added Licenses totals and extended whitelisted SKUs
gavsto Feb 6, 2022
f04a658
Merge pull request #114 from gavsto/dev
gavsto Feb 6, 2022
e225872
NEW API: All Tenant Device Compliance using Lighthouse API
gavsto Feb 6, 2022
0504acb
Merge pull request #115 from gavsto/dev
gavsto Feb 6, 2022
e93cf62
BUG FIX: Corrected an oopsy in the API call for tenant filter
gavsto Feb 6, 2022
088fdd0
Merge pull request #116 from gavsto/dev
gavsto Feb 6, 2022
2979a78
added error handling for everything that requires a license
KelvinTegelaar Feb 11, 2022
67a9f46
added potential exchange error
KelvinTegelaar Feb 11, 2022
21536b5
fixes #735
KelvinTegelaar Feb 11, 2022
cc946b2
improved alerts list
KelvinTegelaar Feb 14, 2022
9b7b321
added set alert function
KelvinTegelaar Feb 14, 2022
0bdbbd6
Update DNSHelper.psm1
JohnDuprey Feb 15, 2022
0864829
Merge remote-tracking branch 'upstream/dev' into dev
JohnDuprey Feb 15, 2022
6429161
Update 4d9206b0-4f96-41e6-86a5-f78cdcff5069.IntuneTemplate.json
KelvinTegelaar Feb 15, 2022
ce10d01
Merge remote-tracking branch 'upstream/dev' into dev
JohnDuprey Feb 15, 2022
d9e5de4
Update DNSHelper.psm1
JohnDuprey Feb 16, 2022
0fec037
Update DNSHelper.psm1
JohnDuprey Feb 16, 2022
a490b29
Update DNSHelper.psm1
JohnDuprey Feb 16, 2022
40d1df9
Update DNSHelper.psm1
JohnDuprey Feb 16, 2022
b95b29a
Update DNSHelper.psm1
JohnDuprey Feb 16, 2022
de6c19a
Merge pull request #117 from johnduprey/dev
KelvinTegelaar Feb 16, 2022
16fa761
fixed minor issues with AAD report.
KelvinTegelaar Feb 16, 2022
ae926e5
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into…
KelvinTegelaar Feb 16, 2022
36d9f9b
scheduler stuff
KelvinTegelaar Feb 16, 2022
665a446
revert issue
KelvinTegelaar Feb 16, 2022
3a7478d
added license report
KelvinTegelaar Feb 17, 2022
64f3091
added option for private teams
KelvinTegelaar Feb 18, 2022
cff6c3e
731
KelvinTegelaar Feb 18, 2022
3179b86
bumped version for release
KelvinTegelaar Feb 18, 2022
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
Prev Previous commit
Next Next commit
scheduler stuff
  • Loading branch information
KelvinTegelaar committed Feb 16, 2022
commit 36d9f9ba1d48f0fca6019a918bb7c99e9990ba7a
19 changes: 19 additions & 0 deletions RemoveQueuedAlert/function.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "Response"
}
]
}
27 changes: 27 additions & 0 deletions RemoveQueuedAlert/run.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using namespace System.Net

# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)

$APIName = $TriggerMetadata.FunctionName
Log-Request -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Accessed this API" -Sev "Debug"

$user = $request.headers.'x-ms-client-principal'
$ID = $request.query.id
try {
Remove-Item "Cache_Scheduler\$($ID).alert.json" -Force
Log-Request -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Removed application queue for $ID." -Sev "Info"
$body = [pscustomobject]@{"Results" = "Successfully removed from queue." }
}
catch {
Log-Request -user $request.headers.'x-ms-client-principal' -API $APINAME -message "Failed to remove from queue $ID. $($_.Exception.Message)" -Sev "Error"
$body = [pscustomobject]@{"Results" = "Failed to remove alert from queue" }
}


# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = $body
})

26 changes: 19 additions & 7 deletions Scheduler_Alert/run.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
param($tenant)

try {
$Alerts = Get-Content ".\Cache_Scheduler\$tenant.alert.json" | ConvertFrom-Json
switch ($Alerts) {

{ $_."AdminPassword" -eq $true } {}
if ($Tenant.tag -eq "AllTenants") {
$Alerts = Get-Content ".\Cache_Scheduler\AllTenants.alert.json" | ConvertFrom-Json
}
else {
$Alerts = Get-Content ".\Cache_Scheduler\$($tenant.tenant).alert.json" | ConvertFrom-Json
}
#Does not work yet.
$ShippedAlerts = switch ($Alerts) {
{ $_."AdminPassword" -eq $true } {
New-GraphGETRequest -uri "https://graph.microsoft.com/beta/roleManagement/directory/roleAssignments?`$filter=roleDefinitionId eq '62e90394-69f5-4237-9190-012177145e10'" -tenantid $($tenant.tenant) | ForEach-Object {
$LastChanges = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/roleManagement/users/$($_.PrincipalID)/`$select=UserPrincipalName,lastPasswordChangeDateTime" -tenant $($tenant.tenant)
if ($LastChanges.LastPasswordChangeDateTime -lt (Get-Date).AddDays(-300)) { Write-Host "Admin password has been changed for $($LastChanges.UserPrincipalName) in last 24 hours" }
}
}
{ $_."DefenderMalware" -eq $true } {}
{ $_."DefenderStatus" -eq $true } {}
{ $_."DisableRestart" -eq $true } {}
Expand All @@ -16,12 +26,14 @@ try {
{ $_."NewRole" -eq $true } {}
{ $_."QuotaUsed" -eq $true } {}
{ $_."UnusedLicenses" -eq $true } {}

}
Write-Host "Shipped in switch."
Write-Host $ShippedAlerts

Log-request -API "Scheduler" -tenant $tenant -message "Collecting alerts for $($tenant)" -sev debug
#EmailAllAlertsInNiceTable
Log-request -API "Scheduler" -tenant $($tenant.tenant) -message "Collecting alerts for $($($tenant.tenant))" -sev debug

}
catch {
Log-request -API "Scheduler" -tenant $tenant -message "Failed to get alerts for $($tenant) Error: $($_.exception.message)" -sev Error
Log-request -API "Scheduler" -tenant $($tenant.tenant) -message "Failed to get alerts for $($($tenant.tenant)) Error: $($_.exception.message)" -sev Error
}
1 change: 1 addition & 0 deletions Scheduler_GetQueue/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $object = foreach ($Tenant in $tenants) {
get-tenants | ForEach-Object {
[pscustomobject]@{
Tenant = $_.defaultDomainName
Tag = "AllTenants"
Type = $Typefile.Type
}
}
Expand Down
2 changes: 1 addition & 1 deletion Scheduler_Orchestration/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ New-Item "Cache_Scheduler\CurrentlyRunning.txt" -ItemType File -Force

$Batch = (Invoke-DurableActivity -FunctionName 'Scheduler_GetQueue' -Input 'LetsGo')
$ParallelTasks = foreach ($Item in $Batch) {
Invoke-DurableActivity -FunctionName "Scheduler_$($item['Type'])" -Input $item['Tenant'] -NoWait
Invoke-DurableActivity -FunctionName "Scheduler_$($item['Type'])" -Input $item -NoWait
}

$Outputs = Wait-ActivityFunction -Task $ParallelTasks
Expand Down
2 changes: 1 addition & 1 deletion Scheduler_Timer/function.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"bindings": [
{
"name": "Timer",
"schedule": "0 */15 * * * *",
"schedule": "0 */1 * * * *",
"direction": "in",
"type": "timerTrigger"
},
Expand Down