<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: can someone help me with a powershell script that fetch reports from identity in Workforce Identity Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425294#M2486</link>
    <description>&lt;P&gt;Hi @mohd azeem khan​&amp;nbsp;&lt;/P&gt;&lt;P&gt;Several community members have shared answers to your question, could you let us know if any of these resolved your issue?&lt;/P&gt;&lt;P&gt;If so, please mark the appropriate answer as “Select as Best” to help other members find the solution easily.&lt;/P&gt;&lt;P&gt;If the issue is still unresolved, I recommend raising a ticket with our support team for further assistance.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Shaked&lt;/P&gt;</description>
    <pubDate>Tue, 25 Nov 2025 12:39:46 GMT</pubDate>
    <dc:creator>CyberArkAlumni</dc:creator>
    <dc:date>2025-11-25T12:39:46Z</dc:date>
    <item>
      <title>can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425287#M2479</link>
      <description>&lt;P&gt;we want a powershell script that fetch reports from identity for audit purpose&lt;/P&gt;&lt;P&gt;any documents, script with readme&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 12:17:09 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425287#M2479</guid>
      <dc:creator>mkhan_PIAS</dc:creator>
      <dc:date>2025-11-18T12:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425288#M2480</link>
      <description>&lt;P&gt;Not an expert, but you can hit the RedRock\Query endpoint to generate reports.  I've only done this for some specific custom use cases, not to export output from the stock reports.  Will share the OAuth client account you create to hit the endpoint will probably wind up needing the Read Only System Administration right as there is the right to access the reports but then you also need access to the underlying data that the report queries.  This will materialize in the request returning success but no results when you know there should be results.  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A alt="https://community.cyberark.com/s/article/How-To-Use-Developer-Tools-To-Determine-API-Calls" href="https://community.cyberark.com/s/article/How-To-Use-Developer-Tools-To-Determine-API-Calls" target="_blank"&gt;How To Use Developer Tools To Determine API Calls&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 13:39:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425288#M2480</guid>
      <dc:creator>CKubiak</dc:creator>
      <dc:date>2025-11-18T13:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425289#M2481</link>
      <description>&lt;P&gt;Hello @mohd azeem khan​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a KB article explaining steps to generate Reports using REST API and PowerShell scripts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A alt="https://community.cyberark.com/s/article/Privilege-Cloud-Shared-Services-Automate-with-REST-API-PowerShell" href="https://community.cyberark.com/s/article/Privilege-Cloud-Shared-Services-Automate-with-REST-API-PowerShell" target="_blank"&gt;Privilege Cloud Shared Services - Automate with REST API &amp;amp; PowerShell&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will help you!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Nov 2025 03:00:18 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425289#M2481</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2025-11-19T03:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425290#M2482</link>
      <description>&lt;P&gt;Hello @mohd azeem khan​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a KB article explaining steps to generate Reports using REST API and PowerShell scripts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A alt="https://community.cyberark.com/s/article/Privilege-Cloud-Shared-Services-Automate-with-REST-API-PowerShell" href="https://community.cyberark.com/s/article/Privilege-Cloud-Shared-Services-Automate-with-REST-API-PowerShell" target="_blank"&gt;Privilege Cloud Shared Services - Automate with REST API &amp;amp; PowerShell&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will help you!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Nov 2025 03:00:18 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425290#M2482</guid>
      <dc:creator>R.Arora270927</dc:creator>
      <dc:date>2025-11-19T03:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425291#M2483</link>
      <description>&lt;P&gt;@Rohini Arora​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in this above article report fetching is not present&lt;/P&gt;&lt;P&gt;help me on this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Nov 2025 08:54:04 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425291#M2483</guid>
      <dc:creator>mkhan_PIAS</dc:creator>
      <dc:date>2025-11-19T08:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425292#M2484</link>
      <description>&lt;P&gt;Hello @mohd azeem khan​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Reports&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Identity Administration &amp;gt; Core Services &amp;gt; Reports &amp;gt; click ‘OAuth Events report’ &amp;gt; Set report filters (time range) &amp;gt; OK&lt;UL&gt;&lt;LI&gt;Report is displayed &amp;gt; AppId ‘_widgetOAuthApp’ corresponds to Shared Services API tokens&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps you!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 03:00:57 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425292#M2484</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2025-11-24T03:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425293#M2485</link>
      <description>&lt;P&gt;Hello @mohd azeem khan​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For Reports&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Identity Administration &amp;gt; Core Services &amp;gt; Reports &amp;gt; click ‘OAuth Events report’ &amp;gt; Set report filters (time range) &amp;gt; OK&lt;UL&gt;&lt;LI&gt;Report is displayed &amp;gt; AppId ‘_widgetOAuthApp’ corresponds to Shared Services API tokens&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps you!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 03:00:57 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425293#M2485</guid>
      <dc:creator>R.Arora270927</dc:creator>
      <dc:date>2025-11-24T03:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425294#M2486</link>
      <description>&lt;P&gt;Hi @mohd azeem khan​&amp;nbsp;&lt;/P&gt;&lt;P&gt;Several community members have shared answers to your question, could you let us know if any of these resolved your issue?&lt;/P&gt;&lt;P&gt;If so, please mark the appropriate answer as “Select as Best” to help other members find the solution easily.&lt;/P&gt;&lt;P&gt;If the issue is still unresolved, I recommend raising a ticket with our support team for further assistance.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Shaked&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 12:39:46 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425294#M2486</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2025-11-25T12:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425295#M2487</link>
      <description>&lt;P&gt;CyberArk does not provide any officially documented or supported PowerShell scripts for generating reports. While I’m not a PowerShell expert, there is a script you might be able to adapt using RedRock queries:&lt;/P&gt;&lt;P&gt;https://github.com/jeffrechten/epv-api-scripts/blob/master/Identity%20Role%20Management/Role-Management.ps1&lt;/P&gt;&lt;P&gt;&lt;B&gt;Please note:&lt;/B&gt; This script is not supported by CyberArk. Use it at your own discretion and risk.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 15:18:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425295#M2487</guid>
      <dc:creator>CyberArkAlumni</dc:creator>
      <dc:date>2025-12-02T15:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: can someone help me with a powershell script that fetch reports from identity</title>
      <link>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425296#M2488</link>
      <description>&lt;P&gt;Likewise, use it at your own discretion and risk.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is an example script to hit the RedRock endpoint and run a custom SQL query.  The setup assumes you have created an OAuth Client app with the appropriate scope, and an OAuth confidential client (service account with the appropriate roles\permissions to access the data you are looking for and entitlement to the OAuth client app).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A alt="https://docs.cyberark.com/identity/latest/en/content/coreservices/authenticate/oauth2-client.htm" href="https://docs.cyberark.com/identity/latest/en/content/coreservices/authenticate/oauth2-client.htm" target="_blank"&gt;Custom OAuth2 Client | CyberArk Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A alt="https://docs.cyberark.com/identity-administration/latest/en/content/ispss/ispss-add-service-user.htm" href="https://docs.cyberark.com/identity-administration/latest/en/content/ispss/ispss-add-service-user.htm" target="_blank"&gt;Add service users | CyberArk Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After the above is stood up should just need to populate the TenantUrl, AppId, ClientId values to be able to generate the bearer token then you can customize the sql string to contain the report info you are interested in gathering (in this example it grabs info on the roles defined in the tenant).  You may need to tweak the scope parameter if you use an alternate value in your client app.&lt;/P&gt;&lt;CODE&gt;$TenantUrl   = ""   # or https://acme.my.idaptive.app
$AppId       = ""         # from the OAuth2 Client app
$ClientId    = ""                # e.g., apiuser@yourtenant
$ClientSecret= Read-Host -AsSecureString "Service user password" | `
               ForEach-Object { [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($_)) }
&amp;nbsp;
$TokenUrl = "$TenantUrl/oauth2/token/$AppId"
&amp;nbsp;
$body = @{
  grant_type    = 'client_credentials'
  client_id     = $ClientId
  client_secret = $ClientSecret
  scope         = 'reporting'   # scope created with REST Regex 'Redrock/query'
}
&amp;nbsp;
$tokenResponse = Invoke-RestMethod -Method POST -Uri $TokenUrl `
  -ContentType 'application/x-www-form-urlencoded' -Body $body
&amp;nbsp;
$headers = @{ Authorization = "Bearer $($tokenResponse.access_token)" }
&amp;nbsp;
$headers | Format-List
&amp;nbsp;
#--------------------------------------------------------------------------------------
&amp;nbsp;
function Invoke-CyberArkIdentityQuery {
    param(
        [Parameter(Mandatory)]
        [string]$TenantUrl,
        [Parameter(Mandatory)]
        [hashtable]$Headers,
        [Parameter(Mandatory)]
        [string]$Sql,
        [int]$PageNumber = 1,
        [int]$PageSize   = 1000,
        [int]$Limit      = 1000,
        [int]$Caching    = -1,      # live data, write to cache
        [bool]$Ascending = $true
    )
&amp;nbsp;
    $uri = "$TenantUrl/Redrock/query"
    $body = @{
        Script = $Sql
        args   = @{
            PageNumber = $PageNumber
            PageSize   = $PageSize
            Limit      = $Limit
            Caching    = $Caching
            direction  = $Ascending
            SortBy     = $SortBy
        }
    } | ConvertTo-Json -Depth 5
&amp;nbsp;
    Invoke-RestMethod -Method POST -Uri $uri -Headers $Headers `
        -ContentType 'application/json' -Body $body
}
&amp;nbsp;
# Example: list user IDs and usernames, sorted case-insensitive
#$sql = "Select ID, Username from User ORDER BY Username COLLATE NOCASE"
#$sql = "Select * from Role WHERE RoleType = 'PrincipalList' ORDER BY Name COLLATE NOCASE"
$sql = "Select * from Role ORDER BY Name COLLATE NOCASE"
$result = Invoke-CyberArkIdentityQuery -TenantUrl $TenantUrl -Headers $headers -Sql $sql
&amp;nbsp;
$result.Result.Columns | ft
$result.Result.Results | ForEach-Object { $_.Row } | Select-Object ID, Name, ReadOnly, IsHidden, RoleType  | Out-GridView&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 16:01:57 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/workforce-identity-discussions/can-someone-help-me-with-a-powershell-script-that-fetch-reports/m-p/1425296#M2488</guid>
      <dc:creator>CKubiak</dc:creator>
      <dc:date>2025-12-02T16:01:57Z</dc:date>
    </item>
  </channel>
</rss>

