当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 使用 PowerShell 更改 SharePoint 中的分布式缓存服务帐户

作者:精品下载站 日期:2024-12-14 20:59:09 浏览:15 分类:玩电脑

使用 PowerShell 更改 SharePoint 中的分布式缓存服务帐户


分布式缓存服务缓存数据,以便跨 SharePoint Server 2013 中的多个功能快速检索,例如新闻源、身份验证、安全修剪、OneNote 客户端访问、页面加载性能等。

安装 SharePoint 2013 时,AppFabric 服务将作为 SharePoint 先决条件的一部分进行安装,并配置为在 Farm 帐户的凭据下运行,这并不理想,并且会在 SharePoint 2013 Health Analyzer 中触发警报。

“服务器场帐户不应用于其他服务。”
域\帐户 用于 SharePoint 计时器服务和管理中心站点的帐户具有很高的特权,不应用于服务器场中任何计算机上的任何其他服务。 发现以下服务使用此帐户:分布式缓存服务(Windows 服务)。

[玩转系统] 使用 PowerShell 更改 SharePoint 中的分布式缓存服务帐户

抱歉,出了点问题
分布式缓存服务不支持管理中心的此操作。请使用 Sharepoint Powershell commandlet。

[玩转系统] 使用 PowerShell 更改 SharePoint 中的分布式缓存服务帐户

设置 SharePoint 2013 分布式缓存服务帐户

因此,您无法使用中央管理站点更改 SharePoint Server 2013 分布式缓存服务帐户。我们必须使用 PowerShell 更改 SharePoint 2013 中的分布式缓存服务帐户。使用管理员帐户登录场服务器,注册托管帐户并运行这些 PowerShell cmdlet。

用于更改 SharePoint 2013 中的分布式缓存服务帐户的 PowerShell 脚本:


Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get the Farm
$Farm=Get-SPFarm

#Get Distributed Cache Service
$CacheService = $Farm.Services | where {$_.Name -eq "AppFabricCachingService"}

#Get the Managed account 
$ManagedAccount = Get-SPManagedAccount -Identity "Crescent\SPS_Services"

#Set Service Account for Distributed Cache Service
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser" 
$cacheService.ProcessIdentity.ManagedAccount = $ManagedAccount
$cacheService.ProcessIdentity.Update()
$cacheService.ProcessIdentity.Deploy()

Write-host "Service Account successfully changed for Distributed Service!" 

验证更改:
脚本执行完成后,通过导航到:管理中心 > 安全 > 配置服务帐户 > 选择 Windows 服务 - 分布式缓存来验证更改。确保显示新的服务帐户。

[玩转系统] 使用 PowerShell 更改 SharePoint 中的分布式缓存服务帐户

如果更改未反映,您可能必须停止、删除并重新添加分布式缓存实例:


Stop-SPDistributedCacheServiceInstance
Remove-SPDistributedCacheServiceInstance
Add-SPDistributedCacheServiceInstance

Microsoft 关于更改分布式缓存服务帐户的 Technet 文章:https://technet.microsoft.com/en-us/library/jj219613.aspx#changesvcacct

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯