File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Modules/CIPPCore/Public/Alerts Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ function Get-CIPPAlertNewAppApproval {
15
15
try {
16
16
$Approvals = New-GraphGetRequest - Uri " https://graph.microsoft.com/beta/identityGovernance/appConsent/appConsentRequests?`$ filter=userConsentRequests/any (u:u/status eq 'InProgress')" - tenantid $TenantFilter
17
17
if ($Approvals.count -gt 0 ) {
18
+ $TenantGUID = (Get-Tenants - TenantFilter $TenantFilter - SkipDomains).customerId
18
19
$AlertData = [System.Collections.Generic.List [PSCustomObject ]]::new()
19
20
foreach ($App in $Approvals ) {
20
21
$userConsentRequests = New-GraphGetRequest - Uri " https://graph.microsoft.com/v1.0/identityGovernance/appConsent/appConsentRequests/$ ( $App.id ) /userConsentRequests" - tenantid $TenantFilter
@@ -33,10 +34,13 @@ function Get-CIPPAlertNewAppApproval {
33
34
AppName = $App.appDisplayName
34
35
RequestUser = $_.createdBy.user.userPrincipalName
35
36
Reason = $_.reason
37
+ RequestDate = $_.createdDateTime
38
+ Status = $_.status # Will allways be InProgress as we filter to only get these but this will reduce confusion when an alert is generated
36
39
AppId = $App.appId
37
40
Scopes = ($App.pendingScopes.displayName -join ' , ' )
38
41
ConsentURL = $consentUrl
39
42
Tenant = $TenantFilter
43
+ TenantId = $TenantGUID
40
44
}
41
45
$AlertData.Add ($Message )
42
46
}
You can’t perform that action at this time.
0 commit comments