ค้นหาเว็บไซต์

จะเพิ่มผู้ดูแลระบบและให้สิทธิ์แก่แอปพลิเคชันบริการโดยใช้ PowerShell ได้อย่างไร


ตามค่าเริ่มต้น กลุ่มผู้ดูแลฟาร์มมีสิทธิ์จัดการแอปพลิเคชันบริการทั้งหมด บ่อยครั้ง คุณอาจต้องเพิ่มผู้ดูแลระบบหรือให้สิทธิ์แก่แอปพลิเคชันบริการ SharePoint พูด,

  • คุณต้องการมอบหมายการดูแลแอปพลิเคชันบริการให้กับผู้ใช้รายอื่นหรือไม่
  • บัญชีผู้ดูแลระบบฟาร์ม SharePoint ไม่ได้ถูกเพิ่มเป็นผู้ดูแลระบบแอปพลิเคชันบริการ หรือไม่มีสิทธิ์ในการเข้าถึงแอปพลิเคชันบริการ

SharePoint ช่วยให้เราสามารถมอบหมายสิทธิ์และกระจายการดูแลแอปพลิเคชันบริการให้กับผู้ใช้หลายรายโดยให้สิทธิ์การเข้าถึงในฐานะผู้ดูแลระบบแอปพลิเคชันบริการหรือผู้ดูแลระบบคุณลักษณะ ผู้ดูแลระบบแอปพลิเคชันบริการเหล่านี้ไม่สามารถสร้าง/ลบแอปพลิเคชันบริการใดๆ ได้ แต่สามารถดำเนินการภายในแอปพลิเคชันบริการของตนที่ไม่ส่งผลกระทบต่อฟาร์มได้ เช่น ผู้ดูแลระบบแอปพลิเคชันบริการการค้นหาสามารถทำการเปลี่ยนแปลงใดๆ กับแอปพลิเคชันบริการการค้นหาได้ แต่ไม่สามารถเปลี่ยนแปลงโทโพโลยีการค้นหาได้

จะเพิ่มผู้ดูแลระบบแอปพลิเคชันบริการใน SharePoint 2016 ได้อย่างไร

หากต้องการเพิ่มผู้ดูแลระบบแอปพลิเคชันบริการ ให้ไปที่:

  1. ผู้ดูแลระบบจากศูนย์กลางของ SharePoint 2016 >> จัดการแอปพลิเคชันบริการ
  2. เลือกแอปพลิเคชันบริการเป้าหมายจากรายการแอปพลิเคชันบริการที่มีอยู่ เช่น “แอปพลิเคชันบริการ Metadata ที่มีการจัดการ” โดยคลิกที่แถวที่เกี่ยวข้อง

  3. ใน Ribbon คลิกที่ปุ่ม "ผู้ดูแลระบบ" ป้อนชื่อผู้ใช้ที่คุณต้องการให้สิทธิ์ผู้ดูแลระบบในแอปพลิเคชันบริการ SharePoint >> คลิกปุ่ม "เพิ่ม"
  4. จากส่วนการอนุญาต เลือก "การควบคุมทั้งหมด" ยอมรับการเปลี่ยนแปลงของคุณโดยคลิกปุ่มตกลง

  5. ในทำนองเดียวกัน หากต้องการเพิ่มการอนุญาต ให้คลิกที่ปุ่ม "การอนุญาต" จาก Ribbon ป้อนผู้ใช้ และเพิ่มการอนุญาตที่เหมาะสมให้กับผู้ใช้

ขั้นตอนเดียวกันนี้ใช้กับการเพิ่มผู้ดูแลระบบแอปพลิเคชันบริการการค้นหา SharePoint 2013 หรือผู้ดูแลระบบแอปพลิเคชันบริการโปรไฟล์ผู้ใช้ เมื่อเพิ่มแล้ว ผู้ดูแลระบบแอปพลิเคชันบริการที่ได้รับมอบหมายเหล่านี้สามารถกำหนดการตั้งค่าสำหรับแอปพลิเคชันบริการเฉพาะในฟาร์มได้ อย่างไรก็ตาม ผู้ดูแลระบบเหล่านี้ไม่สามารถสร้างแอปพลิเคชันบริการใหม่หรือดำเนินการระดับฟาร์ม รวมถึงการเปลี่ยนแปลงโทโพโลยีได้

เมื่อการมอบหมายสิทธิ์เหล่านี้เกิดขึ้นซ้ำ ให้ใช้ PowerShell เพื่อเพิ่มผู้ดูแลระบบและให้สิทธิ์แก่แอปพลิเคชันบริการ เช่น แอปพลิเคชันบริการ Metadata ที่มีการจัดการ

PowerShell เพื่อเพิ่มผู้ดูแลระบบแอปพลิเคชันบริการ

นี่คือ PowerShell เพื่อเพิ่มผู้ดูแลระบบให้กับแอปพลิเคชันบริการใน SharePoint:


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

เพิ่มผู้ดูแลระบบแอปพลิเคชันบริการโปรไฟล์ผู้ใช้และให้สิทธิ์:

มารวมสคริปต์ทั้งสองเข้าด้วยกันโดยการเพิ่มผู้ดูแลระบบและการตั้งค่าสิทธิ์ให้กับแอปพลิเคชันบริการโปรไฟล์ผู้ใช้ใน 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

บทความที่เกี่ยวข้อง