I was wondering how if it would be possible for me to run a portion of a task in a different user context. To provide more specifics, I have an action that downloads and executes a powershell script… But I would like for powershell.exe (and by extension, the script) to be run as the administrator. Is this possible?
This is a difficult thing to do with BigFix, and something I frequently come up against.
Is it that this powershell task cannot be run as the system account for some reason?
I think the best way to accomplish would be to create a scheduled task on the system that runs the powershell script and does so from the admin user context.
The script is used to audit SQL Server configurations, so the user context in which it runs is pretty important. In order for the script to execute properly, there are two options:
Ensure the SQL Server administrator adds the proper permissions for the System account to allow the script to execute without error in SQL Server for the duration of the audit.
Find some way for BigFix to impersonate an account with the proper permission set.
I suppose another option would be to run the script using PSExec to impersonate the correct user. This would be a way to try this without the need for a scheduled task.