Service.SetServiceAccount メソッド

SQL Server サービスの実行に使用するアカウントを設定します。

名前空間:  Microsoft.SqlServer.Management.Smo.Wmi
アセンブリ:  Microsoft.SqlServer.SqlWmiManagement (Microsoft.SqlServer.SqlWmiManagement.dll)

構文

'宣言
Public Sub SetServiceAccount ( _
    userName As String, _
    password As String _
)
'使用
Dim instance As Service 
Dim userName As String 
Dim password As String

instance.SetServiceAccount(userName, _
    password)
public void SetServiceAccount(
    string userName,
    string password
)
public:
void SetServiceAccount(
    String^ userName, 
    String^ password
)
member SetServiceAccount : 
        userName:string * 
        password:string -> unit
public function SetServiceAccount(
    userName : String, 
    password : String
)

パラメーター

  • userName
    型: System.String
    SQL Server サービスを実行しているシステム アカウントを示す String 値です。
  • password
    型: System.String
    システム アカウントのパスワードを示す String 値です。

使用例

WMI プロバイダーを使用したサービスの管理とネットワーク設定

関連項目

参照

Service クラス

Microsoft.SqlServer.Management.Smo.Wmi 名前空間

その他の技術情報

WMI and SQL Server

SQL Server データベース エンジンへの接続