SetServiceAccountPassword Method (SqlService Class)

Applies to: SQL Server

Modifies the password for the account that the referenced service runs under.

Syntax

  
object.SetServiceAccountPassword(AccountOldPassword , ServiceStartPassword)  

Parts

object
A SqlService Class object that represents the service.

Parameters

AccountOldPassword
A string value that specifies the existing password for the account.

ServiceStartPassword
A string value that specifies the new password for the account.

Property Value/Return Value

A uint32 value, which is 0 if the service was successfully modified, 1 if the request is not supported, and any other number to indicate an error.

Remarks