Run Dashboard as Current User

Thanks for the assistance @adam, $User is now evaluating to the user account that is accessing the dashboard via web browser. I can now use this variable to query AD based upon who is accessing the dashboard. The following were the final steps that resolved the issue for me:

  1. Open “C:\Program Files (x86)\Universal\appsettings.json”

  2. Changed Windows Authentication Enabled to “True”
    “Authentication” : {
    “Windows”: {
    “Enabled”: “True
    },

  3. Saved and closed appsettings.json

  4. Restarted the PowerShell Universal Windows Service

  5. Refreshed the dashboard page

  6. When accessing the dashboard in a web browser, the user is now prompted to input their credentials. After entering their domain credentials, the dashboard run the rest of the code based on that user account.

1 Like