Server.ProxyAccount Server.ProxyAccount Server.ProxyAccount Property

Definition

Gets the proxy account associated with the instance of SQL Server.

public:
 property Microsoft::SqlServer::Management::Smo::ServerProxyAccount ^ ProxyAccount { Microsoft::SqlServer::Management::Smo::ServerProxyAccount ^ get(); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcObject(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcObjectRelationship.Object, Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcObjectCardinality.One)]
public Microsoft.SqlServer.Management.Smo.ServerProxyAccount ProxyAccount { get; }
Public ReadOnly Property ProxyAccount As ServerProxyAccount
Property Value

A ServerProxyAccount object that specifies the proxy account associated with the instance of SQL Server.

Examples

Visual Basic

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")  
$js = $srv.JobServer  
$pa = new-object Microsoft.SqlServer.Management.Smo.Agent.ProxyAccount($js, "Test_proxy", "Proxy_accnt", $TRUE, "Proxy account for users to run job steps in command shell.")  
$pa.Create()  
$pa.AddLogin(vLogin)  
$pa.AddSubSystem([Microsoft.SqlServer.Management.Smo.Agent.AgentSubSystem]::CmdExec)  

Remarks

The proxy account defines a security context in which a SQL Server Agent job step can run. The ProxyAccount property points to the ServerProxyAccount object. This object specifies the proxy account that is used by the instance of SQL Server Agent.

Applies to