Syntax
# Function to get an access token
function Get-AccessToken {
param (
[string]$TenantId,
[string]$ClientId,
[string]$ClientSecret
)
$body = @{
grant_type = “client_credentials”
scope = “https://graph.microsoft.com/.default”
client_id = $ClientId
client_secret = $ClientSecret
}
Download Full Script
| Purpose: | Fetch details of users with the ‘admin’ role applied |
| Modification: | |
| Type: | PowerShell Script |
| Compatibility: | PowerShell |
| Tags: | Belongs to O365 |
| Reference link: |