PowerShell Tile - Access Denied on Systemprofile - Problem&Workaround

Hi Community,

just wanted to share a recent finding. I started to create a Dashboard that leverages the new Powershell tile. The script should fire a SQL query via dbatools .

First I created the profile:

+

Second I copied the script that I tested on the SquaredUp-Server directly into the Tile and executed it. - It returned an error.:


(Access to the path ‘C:\WINDOWS\system32\config\systemprofile’ is denied)

WorkAround:
I logged on to the server and granted “network service” read access on the folder mentioned and all sub-folders. Some files could not be modified, but it worked for the important ones:

Finally it worked :slight_smile:

PS: If you are wondering why I am not using the SQL Tile; My “SQL-Days” in the IT-training-school passed long time ago :wink:

2 Likes

Awesome find, Ruben!