<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D50Z00008G7VSRSA3Okta Classic EngineAdministrationAnswered2024-04-17T13:21:51.000Z2016-08-16T17:23:53.000Z2019-01-05T19:11:34.000Z
  • knw1j (knw1j)

    I could also do this with Powershell if I could figure out the AppId for my application. Where can I find the AppID?
  • knw1j (knw1j)

    Thank you. I used your OktaApi module in the PowerShell Gallery, but I cannot get more than 50 entries from the Get-OktaAppUser command:  e.g., get-OktaAppUser –appid 0oa1a44x18tLiG9IK0h8 |format-list > cs26.txt Is there any way around this limitation with PowerShell? Regards, Richard Graham
  • Hi Richard

    The Get-OktaAppUsers function has a -limit argument, so, to get 100 appusers, try this:

    Get-OktaAppUsers -appid 0oa1a44x18tLiG9IK0h8 -limit 100

     

    If you have a much larger number, you should use the pagination feature. There's some sample code here:

    https://github.com/gabrielsroka/OktaAPI.psm1/blob/master/CallOktaAPI.ps1

    See the Get-PagedUsers function, or here's some sample code:

      
    1.  function Get-PagedAppUsers {  $totalAppUsers = 0  $params = @{appid = "0oa1a44x18tLiG9IK0h8"; limit = 20}  do {  $page = Get-OktaAppUsers @params  $appusers = $page.objects  foreach ($appuser in $appusers) {  Write-Host $appuser.credentials.userName             $totalAppUsers++  }  $params = @{url = $page.nextUrl}  } while ($page.nextUrl)  "$totalAppUsers app users found." }
      

    Thanks.

     

    Gabriel Sroka

    Expand Post
  • It looks like the formatting was removed. Here it is again:

     

    function Get-PagedAppUsers {

      $totalAppUsers = 0

      $params = @{appid = "0oa1a44x18tLiG9IK0h8"; limit = 20}

      do {

        $page = Get-OktaAppUsers @params

        $appusers = $page.objects

        foreach ($appuser in $appusers) {

          Write-Host $appuser.credentials.userName

          $totalAppUsers++

        }

        $params = @{url = $page.nextUrl}

      } while ($page.nextUrl)

      "$totalAppUsers app users found."

    }

    Expand Post
This question is closed.
Loading
How to export current usernames for an Okta app?