[玩转系统] 如何使用PowerShell添加管理员并授予服务应用程序权限?
作者:精品下载站 日期:2024-12-14 14:20:05 浏览:16 分类:玩电脑
如何使用PowerShell添加管理员并授予服务应用程序权限?
默认情况下,Farm管理员组具有管理所有服务应用程序的权限。通常,您可能需要添加管理员或授予 SharePoint 服务应用程序权限。说,
- 您是否要将服务应用程序管理委派给其他用户
- SharePoint 场管理员帐户未添加为服务应用程序管理员,或者没有访问服务应用程序的权限。
SharePoint 允许我们通过授予服务应用程序管理员或功能管理员的访问权限来委派权限并将服务应用程序的管理分配给多个用户。这些服务应用程序管理员无法创建/删除任何服务应用程序,但他们可以在其服务应用程序中执行不影响场的操作。例如,搜索服务应用程序管理员可以对搜索服务应用程序进行任何更改,但他们不能对搜索拓扑进行更改。
如何在 SharePoint 2016 中添加服务应用程序管理员?
要添加服务应用程序管理员,请导航至:
- SharePoint 2016 中央管理 >> 管理服务应用程序。
通过单击相应的行,从可用服务应用程序列表中选择目标服务应用程序,例如“托管元数据服务应用程序”。
- 在功能区中,单击“管理员”按钮。输入您希望拥有 SharePoint 服务应用程序管理员权限的用户名 >> 单击“添加”按钮。
-
从权限部分,选择“完全控制”。单击“确定”按钮提交更改。
同样,要添加权限,请单击功能区中的“权限”按钮,输入用户,然后为用户添加适当的权限。
相同的步骤适用于添加 SharePoint 2013 搜索服务应用程序管理员或用户配置文件服务应用程序管理员。添加后,这些委派的服务应用程序管理员可以为场中的特定服务应用程序配置设置。但是,这些管理员无法创建新的服务应用程序或执行场级操作,包括拓扑更改。
当重复这些权限委派时,让我们使用 PowerShell 添加管理员并向服务应用程序授予权限,例如:托管元数据服务应用程序。
PowerShell 添加服务应用程序管理员
以下是将管理员添加到 SharePoint 中的服务应用程序的 PowerShell:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Configuration Variables
$ServiceAppName="Managed Metadata Service Application"
$UserAccount="Crescent\Salaudeen"
$AccessRights = "Full Control"
#Get the service application
$ServiceApp = Get-SPServiceApplication -Name $ServiceAppName
#Convert user account to claims
$UserPrincipal = New-SPClaimsPrincipal -Identity $UserAccount -IdentityType WindowsSamAccountName
#Get the Service Application Security collection
$ServiceAppSecurity = Get-SPServiceApplicationSecurity $ServiceApp -Admin
#Add user & rights to the collection
Grant-SPObjectSecurity $ServiceAppSecurity -Principal $UserPrincipal -Rights $AccessRights
#Apply the Security changes
Set-SPServiceApplicationSecurity $ServiceApp $ServiceAppSecurity -Admin
使用 PowerShell 添加对服务应用程序的权限
向服务应用程序授予权限怎么样?也可以在任何服务应用程序中授予权限子集。类似的代码用于向服务应用程序提供权限,但“-Admin”开关除外。这是一个例子:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Configuration Variables
$ServiceAppName="Managed Metadata Service Application"
$UserAccount="Crescent\Salaudeen"
$AccessRights = "Full Access to Term Store"
#Get the service application
$ServiceApp = Get-SPServiceApplication -Name $ServiceAppName
#Convert user account to claims
$UserPrincipal = New-SPClaimsPrincipal -Identity $UserAccount -IdentityType WindowsSamAccountName
#Get the Service Application Security collection
$ServiceAppSecurity = Get-SPServiceApplicationSecurity $ServiceApp
#Add user & rights to the collection
Grant-SPObjectSecurity $ServiceAppSecurity -Principal $UserPrincipal -Rights $AccessRights
#Apply the Security changes
Set-SPServiceApplicationSecurity $ServiceApp $ServiceAppSecurity
添加 User Profile Service 应用程序管理员并授予权限:
让我们通过在 SharePoint 2016 中添加管理员并设置对用户配置文件服务应用程序的权限来组合这两个脚本,以避免出现“没有可用于服务请求的用户配置文件应用程序”的情况。请联系您的农场管理员。”错误。
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Configuration Variables
$UserAccount="Crescent\Salaudeen"
$AccessRights = "Full Control"
#Convert user account to claims
$UserPrincipal = New-SPClaimsPrincipal -Identity $UserAccount -IdentityType WindowsSamAccountName
#Get the user profile service application
$ServiceApp = Get-SPServiceApplication | ? { $_.TypeName -eq "User Profile Service Application" }
Write-host "Adding Administrator to User Profile Service Application..."
#Get the Service Application Administrators Security collection
$ServiceAppAdmins = Get-SPServiceApplicationSecurity $ServiceApp -Admin
#Add user to the collection
Grant-SPObjectSecurity $ServiceAppAdmins -Principal $UserPrincipal -Rights $AccessRights
#Apply the new Security to service application
Set-SPServiceApplicationSecurity $ServiceApp $ServiceAppAdmins -Admin
Write-host "Granting permission to User Profile Service Application..."
#Get the Service Application Permissions Security collection
$ServiceAppPermission = Get-SPServiceApplicationSecurity $ServiceApp
#Add user & rights to the collection
Grant-SPObjectSecurity $ServiceAppPermission -Principal $UserPrincipal -Rights $AccessRights
#Apply the Security changes
Set-SPServiceApplicationSecurity $ServiceApp $ServiceAppPermission
猜你还喜欢
- 03-30 [玩转系统] 如何用批处理实现关机,注销,重启和锁定计算机
- 02-14 [系统故障] Win10下报错:该文件没有与之关联的应用来执行该操作
- 01-07 [系统问题] Win10--解决锁屏后会断网的问题
- 01-02 [系统技巧] Windows系统如何关闭防火墙保姆式教程,超详细
- 12-15 [玩转系统] 如何在 Windows 10 和 11 上允许多个 RDP 会话
- 12-15 [玩转系统] 查找 Exchange/Microsoft 365 中不活动(未使用)的通讯组列表
- 12-15 [玩转系统] 如何在 Windows 上安装远程服务器管理工具 (RSAT)
- 12-15 [玩转系统] 如何在 Windows 上重置组策略设置
- 12-15 [玩转系统] 如何获取计算机上的本地管理员列表?
- 12-15 [玩转系统] 在 Visual Studio Code 中连接到 MS SQL Server 数据库
- 12-15 [玩转系统] 如何降级 Windows Server 版本或许可证
- 12-15 [玩转系统] 如何允许非管理员用户在 Windows 中启动/停止服务
取消回复欢迎 你 发表评论:
- 精品推荐!
-
- 最新文章
- 热门文章
- 热评文章
[影视] 黑道中人 Alto Knights(2025)剧情 犯罪 历史 电影
[古装剧] [七侠五义][全75集][WEB-MP4/76G][国语无字][1080P][焦恩俊经典]
[实用软件] 虚拟手机号 电话 验证码 注册
[电视剧] 安眠书店/你 第五季 You Season 5 (2025) 【全10集】
[电视剧] 棋士(2025) 4K 1080P【全22集】悬疑 犯罪 王宝强 陈明昊
[软件合集] 25年6月5日 精选软件22个
[软件合集] 25年6月4日 精选软件36个
[短剧] 2025年06月04日 精选+付费短剧推荐33部
[短剧] 2025年06月03日 精选+付费短剧推荐25部
[软件合集] 25年6月3日 精选软件44个
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电视剧] 欢乐颂.5部全 (2016-2024)
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[影视] 【稀有资源】香港老片 艺坛照妖镜之96应召名册 (1996)
[剧集] 神经风云(2023)(完结).4K
[剧集] [BT] [TVB] [黑夜彩虹(2003)] [全21集] [粤语中字] [TV-RMVB]
[实用软件] 虚拟手机号 电话 验证码 注册
[资源] B站充电视频合集,包含多位重量级up主,全是大佬真金白银买来的~【99GB】
[影视] 内地绝版高清录像带 [mpg]
[书籍] 古今奇书禁书三教九流资料大合集 猎奇必备珍藏资源PDF版 1.14G
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电影] 美国队长4 4K原盘REMUX 杜比视界 内封简繁英双语字幕 49G
[电影] 死神来了(1-6)大合集!
[软件合集] 25年05月13日 精选软件16个
[精品软件] 25年05月15日 精选软件18个
[绝版资源] 南与北 第1-2季 合集 North and South (1985) /美国/豆瓣: 8.8[1080P][中文字幕]
[软件] 25年05月14日 精选软件57个
[短剧] 2025年05月14日 精选+付费短剧推荐39部
[短剧] 2025年05月15日 精选+付费短剧推荐36部
- 最新评论
-
- 热门tag