Home Dashboard Directory Help

SQL Server Agent PowerShell subsystem job step fails when ExecutionPolicy has been set via GPO by Nancy Hidy Wilson1



Sign in
to vote
Type: Bug
ID: 802686
Opened: 9/27/2013 12:08:19 PM
Access Restriction: Public
User(s) can reproduce this bug


A default installation of SQL Server 2012 creates a SQL Agent job called syspolicy_purge_history which has a job step (3) that uses the PowerShell subsystem. Apparently, this subsystem always attempts to run “set-executionpolicy RemoteSigned –scope process –Force” before executing the actual code requested in the job step command. When the PowerShell ExecutionPolicy has been set at the MachinePolicy scope via a GPO, then this causes the PowerShell subsystem job step to fail as shown in the attachment. We can reproduce this with any PowerShell Subsystem job step - not just the system job shown. If a MachinePolicy or UserPolicy scope has been set via GPO (as shown in the attachment), then SQL Server should either not try to set a local scope or it should handle this error and continue to attempt to execute the PowerShell commands within the ExecutionPolicy dictated by the GPO.
Sign in to post a comment.
Posted by Microsoft on 1/8/2014 at 8:47 AM
Thanks for the feedback. We triaged this issue and at this time do not plan to address this in a coming version of SQL Server.
Posted by Microsoft on 10/3/2013 at 12:04 PM
Hello Nancy.
Thank you for bringing this to our attention. We really do appreciate the feedback. We’ll investigate and get back to you.
-Walter A Jokiel, Program Manager, SQL Server (wajokiel@microsoft.com)
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
SQL Server Bug 802686 Details.docx 9/27/2013 31 KB