This documentation is archived and is not being maintained.

ServiceProcessInstaller.Password Property

Gets or sets the password associated with the user account under which the service application runs.

Namespace: System.ServiceProcess
Assembly: System.ServiceProcess (in system.serviceprocess.dll)

public string Password { get; set; }
/** @property */
public String get_Password ()

/** @property */
public void set_Password (String value)

public function get Password () : String

public function set Password (value : String)

Not applicable.

Property Value

The password associated with the account under which the service should run. The default is an empty string (""). The property is not public, and is never serialized.

The Password and Username pair allows the service to run under an account other than the system account. This can, for example, allow the service to start automatically at reboot, when no user is logged on.

Password and Username are handled in a secure manner in that they are never serialized or saved to the install state (the project installer's Installer.Context) or other location with public access.

Setting the Username and Password allows an account to be associated automatically with the service at install time. If you leave either the Username or Password empty and set Account to User, you will be prompted for a valid user name and password at installation.

Another option for running a service under a separate account is to use the computer's System account. That account, which is distinct from the Administrator account, requires no password. The System account's privileges may exceed those of the user currently logged in. Running under the System account rather than a user account avoids problems resulting from the user lacking a permission the service requires

If Account is any value other than User, the specifed account (local or network service, or local system) is used, even if the Username and Password properties are populated.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0