We have some deployments which run in the system context and we need to run something as the user that is currently logged on. Try using âExecute-ProcessAsUserâ.
FYI, Detection Logic run context is target dependentâŚ
That is to say, if youâre targeting a User Collection and have custom powershell code in the Detection Logic, that powershell code will be run in user context. Same with targeting Machine Collection and Detection Logic running in system context. Do with that what you will.