共用方式為


ConfigurationSetting 方法 - SetWindowsServiceIdentity

讓報表伺服器 Windows 服務以指定之 Windows 使用者的身分執行,並且授與此帳戶足夠的檔案系統存取權限,以便允許報表伺服器運作。

語法

Public Sub SetWindowsServiceIdentity(UseBuiltInAccount as Boolean, _  
    Account as String, Password as String, ByRef HRESULT as Int32)  
public void SetWindowsServiceIdentity(boolean UseBuiltInAccount,   
    string Account, string Password, out Int32 HRESULT);  

參數

UseBuiltInAccount
指出指定的帳戶是否為內建 Windows 帳戶。

帳戶
要用來執行 Windows 服務的 Windows 帳戶,其格式為 DOMAIN\alias

密碼
此帳戶的密碼。

HRESULT
[out] 指出呼叫成功或失敗的值。

傳回值

傳回 HRESULT ,指出方法呼叫成功或失敗。 值為 0 表示方法呼叫成功。 非零值表示發生錯誤。

備註

UseBuiltInAccount 參數設定為 true,而且報表伺服器正在 Microsoft Windows 2000 或 Windows XP 上執行時,系統會忽略 NameDomainPassword 參數的值並且使用本機系統帳戶。

[UseBuiltInAccount] 參數設定為 [true],且報表伺服器正在 Windows Server 2003 上執行時,系統會略過 [Domain][Password] 屬性,而且名稱欄位必須包含 Builtin\NetworkServiceBuiltin\SystemBuiltin\LocalService

SetWindowsServiceIdentity 方法會在報表伺服器安裝目錄中設定檔案與資料夾的檔案權限。

Account 參數中指定的帳戶需要 Windows 中的 LogonAsService 權限。 此方法會將這個權限授與指定的帳戶。

規格需求

Namespace: root\Microsoft\SqlServer\ReportServer\<InstanceName>\v13\Admin

MSReportServer_ConfigurationSetting 成員