Skip to content

Commit b23a66a

Browse files
Merge pull request #1569 from Zacgoose/appapprovalinfo
Extra info for pending app approvals
2 parents 5928a01 + d4e30a7 commit b23a66a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertNewAppApproval.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function Get-CIPPAlertNewAppApproval {
1515
try {
1616
$Approvals = New-GraphGetRequest -Uri "https://graph.microsoft.com/beta/identityGovernance/appConsent/appConsentRequests?`$filter=userConsentRequests/any (u:u/status eq 'InProgress')" -tenantid $TenantFilter
1717
if ($Approvals.count -gt 0) {
18+
$TenantGUID = (Get-Tenants -TenantFilter $TenantFilter -SkipDomains).customerId
1819
$AlertData = [System.Collections.Generic.List[PSCustomObject]]::new()
1920
foreach ($App in $Approvals) {
2021
$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 {
3334
AppName = $App.appDisplayName
3435
RequestUser = $_.createdBy.user.userPrincipalName
3536
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
3639
AppId = $App.appId
3740
Scopes = ($App.pendingScopes.displayName -join ', ')
3841
ConsentURL = $consentUrl
3942
Tenant = $TenantFilter
43+
TenantId = $TenantGUID
4044
}
4145
$AlertData.Add($Message)
4246
}

0 commit comments

Comments
 (0)