File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Modules/CIPPCore/Public/Alerts Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +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- $AlertData = [System.Collections.Generic.List [string ]]::new()
18+ $AlertData = [System.Collections.Generic.List [PSCustomObject ]]::new()
1919 foreach ($App in $Approvals ) {
2020 $userConsentRequests = New-GraphGetRequest - Uri " https://graph.microsoft.com/v1.0/identityGovernance/appConsent/appConsentRequests/$ ( $App.id ) /userConsentRequests" - tenantid $TenantFilter
2121 $userConsentRequests | ForEach-Object {
@@ -28,7 +28,15 @@ function Get-CIPPAlertNewAppApproval {
2828 " https://login.microsoftonline.com/$ ( $TenantFilter ) /adminConsent?client_id=$ ( $App.appId ) &bf_id=$ ( $App.id ) &redirect_uri=https://entra.microsoft.com/TokenAuthorize"
2929 }
3030
31- $Message = " App name: $ ( $App.appDisplayName ) - Request user: $ ( $_.createdBy.user.userPrincipalName ) - Reason: $ ( $_.reason ) `n App Id: $ ( $App.appId ) - Scopes: $ ( $App.pendingScopes.displayName ) `n Consent URL: $consentUrl "
31+ $Message = [PSCustomObject ]@ {
32+ AppName = $App.appDisplayName
33+ RequestUser = $_.createdBy.user.userPrincipalName
34+ Reason = $_.reason
35+ AppId = $App.appId
36+ Scopes = ($App.pendingScopes.displayName -join ' , ' )
37+ ConsentURL = $consentUrl
38+ Tenant = $TenantFilter
39+ }
3240 $AlertData.Add ($Message )
3341 }
3442 }
You can’t perform that action at this time.
0 commit comments