Freigeben über


Service.SetServiceAccount-Methode

Sets the account under which the SQL Server service runs.

Namespace:  Microsoft.SqlServer.Management.Smo.Wmi
Assembly:  Microsoft.SqlServer.SqlWmiManagement (in Microsoft.SqlServer.SqlWmiManagement.dll)

Syntax

'Declaration
Public Sub SetServiceAccount ( _
    userName As String, _
    password As String _
)
'Usage
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
)

Parameter

  • userName
    Typ: System.String
    A String value that specifies the system account under which the SQL Server service runs.
  • password
    Typ: System.String
    A String value that specifies the password for the system account.

Beispiele

Verwalten von Diensten und Netzwerkeinstellungen durch die Nutzung von WMI-Anbieter

Siehe auch

Verweis

Service Klasse

Microsoft.SqlServer.Management.Smo.Wmi-Namespace

Andere Ressourcen

WMI and SQL Server

Herstellen einer Verbindung zum SQL Server-Datenbankmodul