What are subsystem_id for granting proxy to subsystem say powershell using sp_grant_proxy_to_subsystem

We need to use following SQL for granting access to Powershell subsystem:

USE msdb ;  
GO  
  
EXEC dbo.sp_grant_proxy_to_subsystem  
    @proxy_name = 'Proxy Running Account Name',  
    @subsystem_id = 12;  
GO  

The details for proxy_name and subsystem_id

[ @proxy_name = ] proxy_name
The name of the proxy to grant access for. The proxy_name is sysname, with a default of NULL. Either proxy_id or proxy_name must be specified, but both cannot be specified.

[ @subsystem_id = ] id
The id number of the subsystem to grant access to. The subsystem_id is int, with a default of NULL. Either subsystem_id or subsystem_name must be specified, but both cannot be specified. The following table lists the values for each subsystem.

Value Description
2 Microsoft ActiveX Script

** Important ** The ActiveX Scripting subsystem will be removed from SQL Server Agent in a future version of MicrosoftSQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

3 Operating System (CmdExec)
4 Replication Snapshot Agent
5 Replication Log Reader Agent
6 Replication Distribution Agent
7 Replication Merge Agent
8 Replication Queue Reader Agent
9 Analysis Services Query
10 Analysis Services Command
11 SSIS package execution
12 PowerShell Script

The following example grants the proxy Proxy Running Account Name access to the Powershell execution subsystem.

USE msdb ;  
GO  
  
EXEC dbo.sp_grant_proxy_to_subsystem  
    @proxy_name = N'Proxy Running Account Name',  
    @subsystem_name = N'PowerShell' ;  
GO

The details for subsystem_name

[ @subsystem_name = ] subsystem_name
The name of the subsystem to grant access to. The subsystem_name is sysname, with a default of NULL. Either subsystem_id or subsystem_name must be specified, but both cannot be specified. The following table lists the values for each subsystem.

Value Description
ActiveScripting ActiveX Script
CmdExec Operating System (CmdExec)
Snapshot Replication Snapshot Agent
LogReader Replication Log Reader Agent
Distribution Replication Distribution Agent
Merge Replication Merge Agent
QueueReader Replication Queue Reader Agent
ANALYSISQUERY Analysis Services Query
ANALYSISCOMMAND Analysis Services Command
Dts SSIS package execution
PowerShell PowerShell Script

MSDN sp_grant_proxy_to_subsystem Reference

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s