Skip to content

Commit

Permalink
Merge pull request #18 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
[pull] dev from KelvinTegelaar:dev
  • Loading branch information
JohnDuprey authored Jul 27, 2023
2 parents 8093869 + daca7d7 commit f8807d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Modules/CIPPCore/Public/Revoke-CIPPSessions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ function Revoke-CIPPSessions {

try {
$GraphRequest = New-GraphPostRequest -uri "https://graph.microsoft.com/beta/users/$($userid)/invalidateAllRefreshTokens" -tenantid $TenantFilter -type POST -body '{}' -verbose
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APIName -message "Revoked sessions for $($username)" -Sev "Info" -tenant $TenantFilter
Write-LogMessage -user $ExecutingUser -API $APIName -message "Revoked sessions for $($username)" -Sev "Info" -tenant $TenantFilter
return "Success. All sessions by $username have been revoked"

}
catch {
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APIName -message "Revoked sessions for $($username)" -Sev "Info" -tenant $TenantFilter
Write-LogMessage -user $ExecutingUser -API $APIName -message "Revoked sessions for $($username)" -Sev "Info" -tenant $TenantFilter
return "Revoke Session Failed: $($_.Exception.Message)"
}
}
4 changes: 4 additions & 0 deletions UpdatePermissions/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ foreach ($Row in $Tenants ) {
if (!$CPVRows) {
Write-Output "No list available"
Push-OutputBinding -Name Msg -Value $row.customerId
continue
}

if ($Row.customerId -notin $TenantList) {
Write-Output "Not in the list: $($row.customerId)"
Push-OutputBinding -Name Msg -Value $row.customerId
continue

}

if ($CPVRows | Where-Object { $_.Tenant -eq $row.customerId } | Where-Object { $_.LastApply -EQ $null -or (Get-Date $_.LastApply).AddDays(-14) -gt $currentUTCtime }) {
Write-Output "In list, Old age."
Push-OutputBinding -Name Msg -Value $row.customerId
continue
}
}

0 comments on commit f8807d8

Please sign in to comment.