So im still really new to this… but with hte couple of questions ive asked and by looking through the various posts on here and youtube videos, im creating a dashboard. And ive been pleased with it, its given me the information ive needed and even had a splash of color. My issue is the speed of it whcih i know comes down to my coding.
So far i have two tables, table one shows the top 5 servers for CPU%, table two shows the MemUtilization%.
Both color depending on the % (red, yellow, green)
refreshes every x seconds/minutes
Im having two issues:
if i use an array with manually typed in computer names it all works. The momemnt i change that array to be a “get-adcomputer” the dashboard dont work, even though the array contains the names?
My second issue is speed, im processing around 200 machines to get the above information, but it appears to be taking 4-6minutes to do? and im also doing this per table when i wonder if i should be using new-UDendpoint? and then simply taking the array from that endpoint inot the two tables grabbing CPU and memory respectively?
although ive used powershell for sometime, im still very green in all fairness, and i know i should be able to get this information far quicker, but im simply hitting a mental block and google blind allys so if anyone has advice and even stripped down examples id be so grateful
When you are dealing with multiple servers the best way to speed up the process is to leverage parallel process.
In UD you can use this plan to speed up things.
A- google invoke parallel and implement it in your code.
B- whenever you have a continuous process always add that to $Cache and to a schedule endpoint.
This way the scheduled endpoint will run every 5 min for example and cache your results so when you query your results from cache it will right there right away.
my idea is i want the table to update the relevant information, with a handful of servers it works bt anything more than that, it just sits there, im guessing because ive got the refreshinterval set to 60seconds and the actual information gathering is taking far longer so it has nothing to show
That’s when you get cache and schedule service endpoint in place.
The schedule service endpoint is like scheduled task it runs your command every x amount of time you defined.
And caching the results will help from having to wait for it to process every time you load your page