File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 2121$graphAppId = " 00000003-0000-0000-c000-000000000000"
2222
2323# Requires an admin
24- Connect-MgGraph - Scopes " Application.ReadWrite.All User.Read" - UseDeviceAuthentication - ErrorAction Stop
24+ Connect-MgGraph - Scopes " Application.ReadWrite.All AppRoleAssignment.ReadWrite.All User.Read" - UseDeviceAuthentication - ErrorAction Stop
2525
2626# Get context for access to tenant ID
2727$context = Get-MgContext - ErrorAction Stop
@@ -71,7 +71,6 @@ Write-Host -ForegroundColor Cyan "Added application permissions to app registrat
7171# Add admin consent
7272foreach ($appRole in $resourceAccess )
7373{
74- $appServicePrincipal
7574 New-MgServicePrincipalAppRoleAssignment - ServicePrincipalId $appServicePrincipal.Id `
7675 - PrincipalId $appServicePrincipal.Id - ResourceId $graphServicePrincipal.Id `
7776 - AppRoleId $appRole.Id - ErrorAction SilentlyContinue - ErrorVariable SPError | Out-Null
@@ -101,7 +100,7 @@ Write-Host -ForegroundColor Yellow $clientSecret.EndDateTime
101100
102101if ($StayConnected -eq $false )
103102{
104- Disconnect-MgGraph
103+ Disconnect-MgGraph | Out-Null
105104 Write-Host " Disconnected from Microsoft Graph"
106105}
107106else
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ Write-Host -ForegroundColor Yellow $authTenant
7777
7878if ($StayConnected -eq $false )
7979{
80- Disconnect-MgGraph
80+ Disconnect-MgGraph | Out-Null
8181 Write-Host " Disconnected from Microsoft Graph"
8282}
8383else
You can’t perform that action at this time.
0 commit comments