Anonymous users can't see script output within a table component on a Page. Authenticated admins can

Edit: I was able to get around the limitation by creating a local guest account and having the users sign in then go to the page after turning on authentication and unchecking anonymous on the script. Follow up question, without a bought license is there a way to redirect to login page if someone visits the URL of the page first but isn’t authenticated?

Problem Statement: I’m experiencing an issue where there’s no output from the Table component on a Page that doesn’t require authentication. The linked script also has the anonymous setting enabled. Despite this, I’m encountering 401 errors in the developer tools when I load the page. Although the page and component are visible, there’s no output for anonymous users. I’m looking for suggestions on what else I could check to troubleshoot this problem.

Additional Information: I’ve recently set up PSU on a domain-joined Windows Server 2022. I can access the page directly from other computers using the URL. The Page’s authentication is turned off, and I’ve also enabled the Anonymous setting on the script. The script is quite simple and runs the Search-ADAccounts command to display expired accounts.

When I’m logged in as an admin, I can access the page without any issues. However, when I use a private browsing tab to visit the page, I can see the page with the Table component, but the table doesn’t populate with any information. Upon inspecting the page using Edge’s developer tools, I noticed several 401 errors in the console.

I initially thought that enabling Anonymous would grant access to the page, but this doesn’t seem to be the case. I’m currently trying to create a demo page to present to my team. The goal is to have a few reporting dashboards where our other users, who handle account provisioning, can quickly export or view tables of useful information. Any ideas on how to resolve this issue would be greatly appreciated.