Поделиться через


Класс ProxyAccount

The ProxyAccount class represents a SQL Server Agent proxy account.

Иерархия наследования

System.Object
  Microsoft.SqlServer.Management.Smo.SmoObjectBase
    Microsoft.SqlServer.Management.Smo.SqlSmoObject
      Microsoft.SqlServer.Management.Smo.NamedSmoObject
        Microsoft.SqlServer.Management.Smo.Agent.AgentObjectBase
          Microsoft.SqlServer.Management.Smo.Agent.ProxyAccount

Пространство имен:  Microsoft.SqlServer.Management.Smo.Agent
Сборка:  Microsoft.SqlServer.Smo (в Microsoft.SqlServer.Smo.dll)

Синтаксис

'Декларация
Public NotInheritable Class ProxyAccount _
    Inherits AgentObjectBase _
    Implements IAlterable, ICreatable, IDroppable, IRenamable,  _
    IScriptable
'Применение
Dim instance As ProxyAccount
public sealed class ProxyAccount : AgentObjectBase, 
    IAlterable, ICreatable, IDroppable, IRenamable, IScriptable
public ref class ProxyAccount sealed : public AgentObjectBase, 
    IAlterable, ICreatable, IDroppable, IRenamable, IScriptable
[<SealedAttribute>]
type ProxyAccount =  
    class 
        inherit AgentObjectBase 
        interface IAlterable 
        interface ICreatable 
        interface IDroppable 
        interface IRenamable 
        interface IScriptable 
    end
public final class ProxyAccount extends AgentObjectBase implements IAlterable, ICreatable, IDroppable, IRenamable, IScriptable

Тип ProxyAccount обеспечивает доступ к следующим элементам.

Конструкторы

  Имя Описание
Открытый метод ProxyAccount() Initializes a new instance of the ProxyAccount class.
Открытый метод ProxyAccount(JobServer, String) Initializes a new instance of the ProxyAccount class on the specified SQL Server Agent Service, with the specified name.
Открытый метод ProxyAccount(JobServer, String, String) Initializes a new instance of the ProxyAccount class on the specified SQL Server Agent Service with the specified name and credential.
Открытый метод ProxyAccount(JobServer, String, String, Boolean) Initializes a new instance of the ProxyAccount class on the specified SQL Server Agent Service with the specified name and credential. It also specifies whether the proxy account is enabled.
Открытый метод ProxyAccount(JobServer, String, String, Boolean, String) Initializes a new instance of the ProxyAccount class on the specified SQL Server Agent Service with the specified name and credential. It also specifies whether the proxy account is enabled.

В начало

Свойства

  Имя Описание
Открытое свойство CredentialID Gets the ID value that uniquely identifies the proxy agent credential.
Открытое свойство CredentialIdentity Gets the credential identity.
Открытое свойство CredentialName Gets or sets the name of the credential.
Открытое свойство Description Gets or sets a textual description of the proxy account.
Открытое свойство ID Gets the ID value that uniquely identifies the proxy account.
Открытое свойство IsEnabled Gets or sets the Boolean property value that specifies whether the proxy account is enabled or not.
Открытое свойство Name Gets or sets the name of the object. (Производный от NamedSmoObject.)
Открытое свойство Parent Gets or sets the JobServer object that is the parent of the ProxyAccount object.
Открытое свойство Properties Gets a collection of Property objects that represent the object properties. (Производный от SqlSmoObject.)
Открытое свойство State Gets the state of the referenced object. (Производный от SmoObjectBase.)
Открытое свойство Urn Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (Производный от SqlSmoObject.)
Открытое свойство UserData Gets or sets user-defined data associated with the referenced object. (Производный от SmoObjectBase.)

В начало

Методы

  Имя Описание
Открытый метод AddLogin Adds a Microsoft Windows login account to the proxy account.
Открытый метод AddMsdbRole Adds a Microsoft SQL Server database role to the proxy account.
Открытый метод AddServerRole Adds a Microsoft SQL Server server role to the proxy account.
Открытый метод AddSubSystem Adds a Microsoft SQL Server subsystem to the proxy account.
Открытый метод Alter Updates any ProxyAccount object property changes on an instance of Microsoft SQL Server.
Открытый метод Create Creates a job on the instance of Microsoft SQL Server as defined by the ProxyAccount object.
Открытый метод Discover Discovers a list of type Object. (Производный от SqlSmoObject.)
Открытый метод Drop Removes an existing proxy account.
Открытый метод EnumLogins Enumerates a list of Microsoft Windows login accounts associated with the referenced proxy account.
Открытый метод EnumMsdbRoles Enumerates a list of Microsoft SQL Server database roles associated with the referenced proxy account.
Открытый метод EnumServerRoles Enumerates a list of Microsoft SQL Server server roles associated with the referenced proxy account.
Открытый метод EnumSubSystems Enumerates a list of Microsoft SQL Server subsystems associated with the referenced proxy account.
Открытый метод Equals (Производный от Object.)
Защищенный метод FormatSqlVariant Formats an object as SqlVariant type. (Производный от SqlSmoObject.)
Защищенный метод GetContextDB Gets the context database that is associated with this object. (Производный от SqlSmoObject.)
Защищенный метод GetDBName Gets the database name that is associated with the object. (Производный от AgentObjectBase.)
Открытый метод GetHashCode (Производный от Object.)
Защищенный метод GetPropValue Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptional Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetPropValueOptionalAllowNull Gets a property value of the SqlSmoObject object. (Производный от SqlSmoObject.)
Защищенный метод GetServerObject Gets the server of the SqlSmoObject object. (Производный от SqlSmoObject.)
Открытый метод GetType (Производный от Object.)
Открытый метод Initialize() Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Открытый метод Initialize(Boolean) Initializes the object and forces the properties be loaded. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInitialized Verifies whether the object has been initialized. (Производный от SqlSmoObject.)
Защищенный метод IsObjectInSpace Verifies whether the object is isolated or connected to the instance of SQL Server. (Производный от SqlSmoObject.)
Открытый метод Reassign Reassign the job steps that refer to the current proxy account name to a new proxy account name.
Открытый метод Refresh Refreshes the object and retrieves properties when the object is next accessed. (Производный от SqlSmoObject.)
Открытый метод RemoveLogin Removes a Microsoft Windows login account from the referenced proxy account.
Открытый метод RemoveMsdbRole Removes a Microsoft SQL Server database role from the referenced proxy account.
Открытый метод RemoveServerRole Removes a Microsoft SQL Server server role from the referenced proxy account.
Открытый метод RemoveSubSystem Removes a Microsoft SQL Server subsystem from the referenced proxy account.
Открытый метод Rename Renames a proxy account.
Открытый метод Script() Generates a Transact-SQL script that can be used to re-create the SQL Server Agent proxy account.
Открытый метод Script(ScriptingOptions) Generates a Transact-SQL script that can be used to re-create the SQL Server Agent proxy account as specified by the scripting options.
Защищенный метод SetParentImpl Sets the parent of the SqlSmoObject to the newParent parameter. (Производный от SqlSmoObject.)
Открытый метод ToString Returns a String that represents the referenced object. (Производный от SqlSmoObject.)
Открытый метод Validate Validates the state of an object. (Производный от SmoObjectBase.)

В начало

События

  Имя Описание
Открытое событие PropertyChanged Represents the event that occurs when a property is changed. (Производный от SqlSmoObject.)
Открытое событие PropertyMetadataChanged Represents the event that occurs when property metadata changes. (Производный от SqlSmoObject.)

В начало

Явные реализации интерфейса

  Имя Описание
Явная реализация интерфейсаЗакрытый метод IAlienObject.Discover Discovers any dependencies. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetDomainRoot Returns the root of the domain. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetParent Gets the parent of this object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyType Gets the type of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetPropertyValue Gets the value of the specified property. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.GetUrn Gets the Unified Resource Name (URN) of the object. Не ссылайтесь на этот элемент непосредственно из кода. Он поддерживает работу инфраструктуры SQL Server. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.Resolve Gets the instance that contains the information about the object from the Unified Resource Name (URN) of the object. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetObjectState Sets the object state to the specified SfcObjectState value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод IAlienObject.SetPropertyValue Sets the property value. (Производный от SqlSmoObject.)
Явная реализация интерфейсаЗакрытый метод ISfcPropertyProvider.GetPropertySet Gets the interface reference to the set of properties of this object. (Производный от SqlSmoObject.)

В начало

Замечания

Proxy accounts allow for the impersonation of logins, server roles, and database roles when executing a job step in any subsystem other than Transact-SQL. In SQL Server Management Objects (SMO), the ProxyAccount object allows programmatic control over proxy accounts. The ProxyAccount object describes the relationship between an alternative (proxy) login account, a subsystem that is used for job step execution, and a list of Microsoft SQL Server logins, server roles, and database roles.

To get ProxyAccount object properties, users must be a member of the SQLAgentOperatorRole on the MSDB database, or be a member of the sysadmin fixed server role.

To set ProxyAccount object properties, users must be a member of the sysadmin fixed server role.

To create or drop a proxy account, users must be a member of the sysadmin fixed server role.

To add or remove subsystems from the proxy account, users must be a member of the sysadmin fixed server role.

Thread Safety

Все общие статические члены этого типа (Shared в Microsoft Visual Basic) можно использовать в многопоточных операциях. Потокобезопасная работа с членами экземпляров типа не гарантируется.

Примеры

Планирование автоматических административных задач в агенте SQL Server

Безопасность многопоточности

Любые открытые статический (Shared в Visual Basic) элементы этого типа потокобезопасны. Потокобезопасность с элементами экземпляров не гарантируется.

См. также

Справочник

Пространство имен Microsoft.SqlServer.Management.Smo.Agent

Другие ресурсы

Планирование автоматических административных задач в агенте SQL Server

Задачи автоматизированного администрирования (агент SQL Server)

Хранимая процедура sp_add_proxy (Transact-SQL)

sp_grant_proxy_to_subsystem (Transact-SQL)