$headers = @{ 'Authorization' = "Bearer $accesstoken" 'Content-Type' = 'application/json' } $requesturi = "https://graph.microsoft.com/v1.0/users" $ret = (Invoke-RestMethod -Uri $requesturi -Headers $headers -Method Get) $ret.Value |Select DisplayName,Mail, UserPrincipalName $ret |ConvertTo-Json