Pode.Web
Pode.Web copied to clipboard
Timeout when query large amounts of data
Question
Hi,
I'm currently building a report for our AD which has about 85k users. When i run a query for all users, for example when try to output all users into a table, the browser crashes. I'm using Chrome Version 114.0.5735.199 (Official Build) (64-bit) on Windows Server 2022. Latest version of Pode.web
` New-PodeWebContainer -Content @( New-PodeWebTable -Name 'All Users' -DataColumn "Name" -Compact -SimpleFilter -ScriptBlock { foreach ($user in (Get-ADUser -Filter * -Properties * | select-object Name, SamAccountName, UserPrincipalName, Title, Department, Mail, DistinguishedName, ObjectGUID)) { [ordered]@{ Name = $user.Name SamAccountName = "$($user.SamAccountName)" UserPrincipalName = "$($user.UserPrincipalName)" Department = "$($user.Department)" Mail = "$($user.Mail)" Title = "$($user.Title)" DistinguishedName = "$($user.DistinguishedName)" ObjectGUID = "$($user.ObjectGUID )"
}
}
}
)
) `
I've also set the following request limits on my server.psd1 file;
` @{ Web = @{ Static = @{ Cache = @{ Enable = $true } } } Server = @{ Request = @{ Timeout = 3600 BodySize = 1000MB } } }
`
If i run the above query on a selected OU, it works ok, its just when it runs the entire domain.
Any advice or support would be appreciated ? Thanks
just to give an update on this. I've managed to get some data to load now by adding -Paginate option to the table. However if i then click to view the 2nd page of the navigation at the bottom of the data it tries to reload the data and times out again.
Is there a way to cache this command within Powershell Get-ADUser -Filter * or pre populate to other paginate pages so they dont try to reload when going through the table pages ?
Hi @fitzwar,
There isn't any inbuilt caching in Pode yet, I do have plans to add it though. You can mimic a cache however using Pode's State feature. When you've retrieved the users once, store them in Pode's state, and then check/retrieve the users from state in future queries - you could add a custom TTL property as well, to refresh the users at times (possibly via a Pode Schedule to prevent timeouts).
Hope that helps :)