ServiceProcessInstaller.Account 屬性

定義

取得或設定要執行這個服務應用程式的帳戶類型。

public:
 property System::ServiceProcess::ServiceAccount Account { System::ServiceProcess::ServiceAccount get(); void set(System::ServiceProcess::ServiceAccount value); };
public System.ServiceProcess.ServiceAccount Account { get; set; }
[System.ServiceProcess.ServiceProcessDescription("ServiceProcessInstallerAccount")]
public System.ServiceProcess.ServiceAccount Account { get; set; }
member this.Account : System.ServiceProcess.ServiceAccount with get, set
[<System.ServiceProcess.ServiceProcessDescription("ServiceProcessInstallerAccount")>]
member this.Account : System.ServiceProcess.ServiceAccount with get, set
Public Property Account As ServiceAccount

屬性值

ServiceAccount,定義系統執行這個服務的帳號類型, 預設為 User

屬性

備註

Account當 屬性為 User 時, Username 會使用 和 Password 屬性來定義服務應用程式執行所在的帳戶。

UsernamePassword 配對可讓服務在系統帳戶以外的帳戶下執行。 例如,當沒有任何使用者登入時,這可讓服務在重新開機時自動啟動。 如果您將 或 Password 保留 Username 為 空白,且設定 AccountUser ,系統會在安裝時提示您輸入有效的使用者名稱和密碼。

您也可以指定服務在本機系統帳戶下執行,或指定為本機或網路服務。 如需帳戶類型的詳細資訊, ServiceAccount 請參閱 列舉。

適用於

另請參閱