{"id":8710,"date":"2025-04-05T03:40:40","date_gmt":"2025-04-05T03:40:40","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=8710"},"modified":"2025-04-05T03:40:41","modified_gmt":"2025-04-05T03:40:41","slug":"how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai","title":{"rendered":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pariswells.com\/blog\/research\/how-to-setup-new-app-in-entra-with-cloudapp-api-permissions\" data-type=\"post\" data-id=\"8708\">Use this to create the App for the Tenantid\\clientid and ClientSecret<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"># Define variables with your values\n$tenantId = \"xxxx\"\n$clientId = \"xxxxx\"\n$clientSecret = \"xxxxxx\"\n$outputFile = \"C:\\Temp\\AllGenerativeAIUsage.csv\"\n\n# Function to get an access token\nfunction Get-AccessToken {\n    param (\n        [string]$TenantId,\n        [string]$ClientId,\n        [string]$ClientSecret\n    )\n    $tokenUrl = \"https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token\"\n    $body = @{\n        grant_type    = \"client_credentials\"\n        client_id     = $ClientId\n        client_secret = $ClientSecret\n        scope         = \"https:\/\/graph.microsoft.com\/.default\"\n    }\n    try {\n        $tokenResponse = Invoke-RestMethod -Uri $tokenUrl -Method Post -Body $body\n        Write-Host \"Access Token obtained successfully.\"\n        return $tokenResponse.access_token\n    } catch {\n        Write-Error \"Failed to obtain access token: $_\"\n        exit\n    }\n}\n\n# Get the access token\n$accessToken = Get-AccessToken -TenantId $tenantId -ClientId $clientId -ClientSecret $clientSecret\n$headers = @{\n    \"Authorization\" = \"Bearer $accessToken\"\n    \"Content-Type\"  = \"application\/json\"\n}\n\n# Get all streams\n$streamsUrl = \"https:\/\/graph.microsoft.com\/beta\/security\/dataDiscovery\/cloudAppDiscovery\/uploadedStreams\"\ntry {\n    $streamsResponse = Invoke-RestMethod -Uri $streamsUrl -Headers $headers -Method Get\n    Write-Host \"Streams found: $($streamsResponse.value.Count)\"\n} catch {\n    Write-Error \"Failed to retrieve streams: $_\"\n    exit\n}\n\n# Initialize an array to store results\n$results = @()\n\n# Loop through each stream to find Generative AI apps\nforeach ($stream in $streamsResponse.value) {\n    $streamId = $stream.id\n    $streamName = $stream.displayName\n    Write-Host \"Checking stream: $streamName (ID: $streamId)\"\n\n    # Get all discovered apps for the stream (last 90 days) with pagination\n    $appsUrl = \"https:\/\/graph.microsoft.com\/beta\/security\/dataDiscovery\/cloudAppDiscovery\/uploadedStreams\/$streamId\/aggregatedAppsDetails(period=duration'P90D')\"\n    $allApps = @()\n    $nextLink = $appsUrl\n    while ($nextLink) {\n        try {\n            $response = Invoke-RestMethod -Uri $nextLink -Headers $headers -Method Get\n            $allApps += $response.value\n            $nextLink = $response.'@odata.nextLink'\n            Write-Host \"Fetched $($allApps.Count) apps so far for stream ${streamName}...\"\n        } catch {\n            Write-Warning \"Failed to retrieve apps for stream ${streamName}: $_\"\n            $nextLink = $null\n        }\n    }\n    Write-Host \"Total apps found in stream ${streamName}: $($allApps.Count)\"\n\n    # Filter for Generative AI category or ChatGPT\/OpenAI by name\/domain\n    foreach ($app in $allApps) {\n        $appId = $app.id\n        $appName = $app.displayName\n        $appCategory = $app.category\n        $appDomain = $app.domain\n        if ($appCategory -ieq \"generativeAi\" -or $appName -match \"ChatGPT\" -or $appName -match \"OpenAI\" -or $appDomain -match \"openai.com\") {\n            Write-Host \"Generative AI app found in stream ${streamName}: $appName (ID: $appId, Category: $appCategory, Domain: $appDomain)\"\n            $usersUrl = \"$appsUrl\/$appId\/users\"\n            try {\n                $usersResponse = Invoke-RestMethod -Uri $usersUrl -Headers $headers -Method Get\n                Write-Host \"Users found for ${appName}: $($usersResponse.value.Count)\"\n                if ($usersResponse.value.Count -gt 0) {\n                    Write-Host \"Usernames: $($usersResponse.value.userIdentifier -join ', ')\"\n                }\n                foreach ($user in $usersResponse.value) {\n                    $results += [PSCustomObject]@{\n                        Stream        = $streamName\n                        AppName       = $appName\n                        Username      = $user.userIdentifier\n                        ActivityCount = $user.activityCount\n                    }\n                }\n            } catch {\n                Write-Warning \"Failed to retrieve users for $appName in stream ${streamName}: $_\"\n            }\n        }\n    }\n}\n\n# Export results to CSV\nif ($results.Count -gt 0) {\n    $results | Export-Csv -Path $outputFile -NoTypeInformation\n    Write-Host \"Generative AI usage exported to $outputFile with $($results.Count) entries.\"\n} else {\n    Write-Host \"No Generative AI usage data found to export across all streams.\"\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Use this to create the App for the Tenantid\\clientid and ClientSecret<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8710","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Use this to create the App for the Tenantid\\clientid and ClientSecret # Define variables with your values $tenantId = &quot;xxxx&quot; $clientId = &quot;xxxxx&quot; $clientSecret = &quot;xxxxxx&quot; $outputFile = &quot;C:\\Temp\\AllGenerativeAIUsage.csv&quot; # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = &quot;https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token&quot; $body = @{ grant_type = &quot;client_credentials&quot; client_id\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"paris\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Welcome to Pariswells.com |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com\" \/>\n\t\t<meta property=\"og:description\" content=\"Use this to create the App for the Tenantid\\clientid and ClientSecret # Define variables with your values $tenantId = &quot;xxxx&quot; $clientId = &quot;xxxxx&quot; $clientSecret = &quot;xxxxxx&quot; $outputFile = &quot;C:\\Temp\\AllGenerativeAIUsage.csv&quot; # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = &quot;https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token&quot; $body = @{ grant_type = &quot;client_credentials&quot; client_id\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-04-05T03:40:40+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-04-05T03:40:41+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Use this to create the App for the Tenantid\\clientid and ClientSecret # Define variables with your values $tenantId = &quot;xxxx&quot; $clientId = &quot;xxxxx&quot; $clientSecret = &quot;xxxxxx&quot; $outputFile = &quot;C:\\Temp\\AllGenerativeAIUsage.csv&quot; # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = &quot;https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token&quot; $body = @{ grant_type = &quot;client_credentials&quot; client_id\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#article\",\"name\":\"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com\",\"headline\":\"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )\",\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"},\"datePublished\":\"2025-04-05T03:40:40+00:00\",\"dateModified\":\"2025-04-05T03:40:41+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#webpage\"},\"articleSection\":\"Research\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"position\":2,\"name\":\"Research\",\"item\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#listItem\",\"name\":\"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#listItem\",\"position\":3,\"name\":\"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/category\\\/research#listItem\",\"name\":\"Research\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\",\"name\":\"Welcome to Pariswells.com\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris\",\"name\":\"paris\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"paris\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#webpage\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai\",\"name\":\"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com\",\"description\":\"Use this to create the App for the Tenantid\\\\clientid and ClientSecret # Define variables with your values $tenantId = \\\"xxxx\\\" $clientId = \\\"xxxxx\\\" $clientSecret = \\\"xxxxxx\\\" $outputFile = \\\"C:\\\\Temp\\\\AllGenerativeAIUsage.csv\\\" # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = \\\"https:\\\/\\\/login.microsoftonline.com\\\/$TenantId\\\/oauth2\\\/v2.0\\\/token\\\" $body = @{ grant_type = \\\"client_credentials\\\" client_id\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/research\\\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/author\\\/paris#author\"},\"datePublished\":\"2025-04-05T03:40:40+00:00\",\"dateModified\":\"2025-04-05T03:40:41+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/\",\"name\":\"Welcome to Pariswells.com\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/pariswells.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com","description":"Use this to create the App for the Tenantid\\clientid and ClientSecret # Define variables with your values $tenantId = \"xxxx\" $clientId = \"xxxxx\" $clientSecret = \"xxxxxx\" $outputFile = \"C:\\Temp\\AllGenerativeAIUsage.csv\" # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = \"https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token\" $body = @{ grant_type = \"client_credentials\" client_id","canonical_url":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#article","name":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com","headline":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )","author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"},"datePublished":"2025-04-05T03:40:40+00:00","dateModified":"2025-04-05T03:40:41+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#webpage"},"isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#webpage"},"articleSection":"Research"},{"@type":"BreadcrumbList","@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/pariswells.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","position":2,"name":"Research","item":"https:\/\/pariswells.com\/blog\/category\/research","nextItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#listItem","name":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )"},"previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#listItem","position":3,"name":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )","previousItem":{"@type":"ListItem","@id":"https:\/\/pariswells.com\/blog\/category\/research#listItem","name":"Research"}}]},{"@type":"Organization","@id":"https:\/\/pariswells.com\/blog\/#organization","name":"Welcome to Pariswells.com","url":"https:\/\/pariswells.com\/blog\/"},{"@type":"Person","@id":"https:\/\/pariswells.com\/blog\/author\/paris#author","url":"https:\/\/pariswells.com\/blog\/author\/paris","name":"paris","image":{"@type":"ImageObject","@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/93b8ee3f592ac401167f870452bd82d43de80152cd3524e2853403658ada9984?s=96&d=mm&r=g","width":96,"height":96,"caption":"paris"}},{"@type":"WebPage","@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#webpage","url":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai","name":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com","description":"Use this to create the App for the Tenantid\\clientid and ClientSecret # Define variables with your values $tenantId = \"xxxx\" $clientId = \"xxxxx\" $clientSecret = \"xxxxxx\" $outputFile = \"C:\\Temp\\AllGenerativeAIUsage.csv\" # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = \"https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token\" $body = @{ grant_type = \"client_credentials\" client_id","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/pariswells.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai#breadcrumblist"},"author":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"creator":{"@id":"https:\/\/pariswells.com\/blog\/author\/paris#author"},"datePublished":"2025-04-05T03:40:40+00:00","dateModified":"2025-04-05T03:40:41+00:00"},{"@type":"WebSite","@id":"https:\/\/pariswells.com\/blog\/#website","url":"https:\/\/pariswells.com\/blog\/","name":"Welcome to Pariswells.com","inLanguage":"en-US","publisher":{"@id":"https:\/\/pariswells.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Welcome to Pariswells.com |","og:type":"article","og:title":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com","og:description":"Use this to create the App for the Tenantid\\clientid and ClientSecret # Define variables with your values $tenantId = &quot;xxxx&quot; $clientId = &quot;xxxxx&quot; $clientSecret = &quot;xxxxxx&quot; $outputFile = &quot;C:\\Temp\\AllGenerativeAIUsage.csv&quot; # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = &quot;https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token&quot; $body = @{ grant_type = &quot;client_credentials&quot; client_id","og:url":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai","article:published_time":"2025-04-05T03:40:40+00:00","article:modified_time":"2025-04-05T03:40:41+00:00","twitter:card":"summary","twitter:title":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai ) | Welcome to Pariswells.com","twitter:description":"Use this to create the App for the Tenantid\\clientid and ClientSecret # Define variables with your values $tenantId = &quot;xxxx&quot; $clientId = &quot;xxxxx&quot; $clientSecret = &quot;xxxxxx&quot; $outputFile = &quot;C:\\Temp\\AllGenerativeAIUsage.csv&quot; # Function to get an access token function Get-AccessToken { param ( [string]$TenantId, [string]$ClientId, [string]$ClientSecret ) $tokenUrl = &quot;https:\/\/login.microsoftonline.com\/$TenantId\/oauth2\/v2.0\/token&quot; $body = @{ grant_type = &quot;client_credentials&quot; client_id"},"aioseo_meta_data":{"post_id":"8710","title":null,"description":null,"keywords":null,"keyphrases":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2025-12-10 10:36:33","updated":"2025-12-10 10:36:33","primary_term":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/pariswells.com\/blog\/category\/research\" title=\"Research\">Research<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/pariswells.com\/blog"},{"label":"Research","link":"https:\/\/pariswells.com\/blog\/category\/research"},{"label":"How to query cloudapps to get a list of all usernaames that have navigated to a specific Category ( generative ai )","link":"https:\/\/pariswells.com\/blog\/research\/how-to-query-cloudapps-to-get-a-list-of-all-usernaames-that-have-navigated-to-a-specific-category-generative-ai"}],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=8710"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8710\/revisions"}],"predecessor-version":[{"id":8711,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8710\/revisions\/8711"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=8710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=8710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=8710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}