I'm trying to run a SharePoint Warm-up PowerShell script (spbestwarmup) from a Scheduled Task under/as a certain service account (also run when user is not logged on). This script tries to get elevated rights and outputs some logging to the Windows 'Application' Event Log.
I already tried everything mentioned in this SO answer here: How to run a PowerShell script from a batch file
The only way I got it to work was by pointing the scheduled task to a .bat
file with the following content:
powershell -command "& 'D:\SPBestWarmUp.ps1' "
which triggers the PowerShell script file. AND I had to add the service account to the local built-in 'Administrators' user group on my SharePoint server.
This last action, adding the user to the 'Administrators' group isn't allowed in my customers IT infrastructure, because of security reasons. They use, rightfully off-course, the law of least privilege. So my question is:
What MINIMAL rights/privileges/policies etc. does a service account need in this case? So I don't need to assign local Administrator rights to it.