Metodo Service.SetServiceAccount

Sets the account under which the SQL Server service runs.

Spazio dei nomi  Microsoft.SqlServer.Management.Smo.Wmi
Assembly:  Microsoft.SqlServer.SqlWmiManagement (in Microsoft.SqlServer.SqlWmiManagement.dll)

Sintassi

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

Parametri

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

Esempi

Gestione di servizi e di impostazioni di rete tramite il provider WMI

Vedere anche

Riferimento

Service Classe

Spazio dei nomi Microsoft.SqlServer.Management.Smo.Wmi

Altre risorse

WMI and SQL Server

Connessione al Motore di database di SQL Server