Forum Discussion
Intune | Powershell Script
- Dec 31, 2020
Hi AnuragSrivastava,
I can't add more to the execution context except of the UAC question, which comes up quite often here. In system context you don't have to worry about UAC. You are system and can do whatever you want then.
Last thing to mention is the different context, as already described, results also in different resolving of environment variables like %username% is not the logged on user it is the user SYSTEM then. Or take %userprofile% it will result in C:\Windows\System32\Config\systemprofile.
best,
Oliver
Hi AnuragSrivastava;
Yes, the system context will make the script runs with admin privileges. The "Local System" account is used and this account has always admin privileges on a device.
But in that case, the script will be executed in an other context as the one of the logged on user. So, if you want, for example, to uninstall an application which has been installed per-user (in the user context), you have to adapt your script accordingly.