Server.Credentials Property

Credential オブジェクトのコレクションを表します。各 Credential オブジェクトは、Microsoft SQL Server のインスタンスで定義された資格情報を表します。

名前空間: Microsoft.SqlServer.Management.Smo
アセンブリ: Microsoft.SqlServer.Smo (microsoft.sqlserver.smo.dll 内)

構文

'宣言
Public ReadOnly Property Credentials As CredentialCollection
public CredentialCollection Credentials { get; }
public:
property CredentialCollection^ Credentials {
    CredentialCollection^ get ();
}
/** @property */
public CredentialCollection get_Credentials ()
public function get Credentials () : CredentialCollection

プロパティ値

SQL Server のインスタンスで定義されたすべての資格情報を表す CredentialCollection オブジェクトです。

解説

更新されたテキスト :

資格情報は、アカウント名とパスワードを保存して、外部リソースへの権限を取得するために使用されます。たとえば、SQL Server エージェント プロキシ アカウントは資格情報を使用して、さまざまなサブシステムへのアクセスに必要なアカウントおよびパスワード情報を保存します。これは、SQL Server エージェント ジョブの一部として使用される場合もあります。

この名前空間、クラス、またはメンバは、Microsoft .NET Framework Version 2.0 でのみサポートされています。

使用例

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Declare a JobServer object variable and reference the SQL Agent.
Dim js As JobServer
js = srv.JobServer
'Define a Credential object variable by supplying the parent server and name arguments in the constructor.
Dim c As Credential
c = New Credential(srv, "Proxy_accnt")
'Set the identity to a valid login represented by the vIdentity string variable. 
'The sub system will run under this login.
c.Identity = vIdentity
'Create the credential on the instance of SQL Server.
c.Create()
'Define a ProxyAccount object variable by supplying the SQL Agent, the name, the credential, the description arguments in the constructor.
Dim pa As ProxyAccount
pa = New ProxyAccount(js, "Test_proxy", "Proxy_accnt", True, "Proxy account for users to run job steps in command shell.")
'Create the proxy account on the SQL Agent.
pa.Create()
'Add the login, represented by the vLogin string variable, to the proxy account. 
pa.AddLogin(vLogin)
'Add the CmdExec subsytem to the proxy account. 
pa.AddSubSystem(AgentSubSystem.CmdExec)
'Now users logged on as vLogin can run CmdExec job steps with the specified credentials.

スレッド セーフ

この型の public static (Microsoft Visual Basic では共有 ) メンバは、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

対象プラットフォーム

サポートされているプラットフォームの一覧については、「SQL Server 2005 のインストールに必要なハードウェアおよびソフトウェア」を参照してください。

参照

関連項目

Server Class
Server Members
Microsoft.SqlServer.Management.Smo Namespace

その他の技術情報

Visual Basic .NET でプロキシ アカウントを使用することでユーザーがサブシステムにアクセスできるようにする方法
コレクションの使用
サーバーの管理

変更履歴

リリース

履歴

新しい内容 :
  • 「例」セクションにコード サンプルを追加しました。

  • 「解説」セクションに説明を追加しました。