如何重設對 Windows Token 服務的宣告帳戶 (SharePoint Server 2010)

 

適用版本: SharePoint Server 2010

上次修改主題的時間: 2010-11-19

案例:「對 Windows Token 服務的宣告」帳戶無意中變更,或需要重設回預設值。

解決方案

「對 Windows Token 服務的宣告」無法透過管理中心重設為本機系統帳戶。下列 Windows PowerShell Cmdlet 可用來將「對 Windows Token 服務的宣告」重設回本機系統。

從執行 SharePoint Server 的電腦啟動 SharePoint 管理命令介面。

執行下列 Cmdlet 以檢視服務清單。

Get-SPServiceInstance

尋找並複製「對 Windows Token 服務的宣告」的識別碼。在 Windows PowerShell 視窗上按一下滑鼠右鍵,然後選擇 [標記],即可讓您使用滑鼠游標選取及複製識別碼。反白識別碼之後,按下鍵盤上的 ENTER 鍵。

執行下列 Cmdlet 以測試識別碼。

Get-SPServiceInstance -identity <Paste the C2WTS Id>

在 PowerShell 視窗上按一下滑鼠右鍵,然後貼上先前複製的識別碼。

接著執行此 Cmdlet 以設定變數:

$claims = get-spserviceinstance -identity <Paste the C2WTS Id>

執行這些 Cmdlet 將 C2WTS 重設回本機系統:

$claims.Service.ProcessIdentity.CurrentIdentityType=0 
// The 0 in the preceding line is IdentityType.LocalSystem
$claims.Service.ProcessIdentity.Update()
$claims.Service.ProcessIdentity.Deploy()
$claims.Service.ProcessIdentity 
// This output demonstrates that the cmdlet was successful
CurrentIdentityType : LocalSystem
CurrentSecurityIdentifier : S-1-5-18
ManagedAccount :
ProcessAccount : S-1-5-18
Username : NT AUTHORITY\SYSTEM