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

Set-MsolServicePrincipal - อัปเดตคุณสมบัติของบริการหลัก


Set-MsolServicePrincipal cmdlet ใน PowerShell อัปเดตหลักการบริการใน Microsoft Office 365

ไวยากรณ์ในการเปลี่ยนแปลงคุณสมบัติของบริการหลักใน Microsoft Azure Active Directory มีดังต่อไปนี้

Set-MsolServicePrincipal
   [-ObjectId <Guid>]
   [-AppPrincipalId <Guid>]
   [-DisplayName <String>]
   [-ServicePrincipalNames <String[]>]
   [-AccountEnabled <Boolean>]
   [-Addresses <RedirectUri[]>]
   [-TenantId <Guid>]
   [<CommonParameters>]

ในบทความนี้ เราจะหารือถึงวิธีการใช้ Set-MsolServicePrincipal cmdlet ใน PowerShell เพื่ออัปเดตคุณสมบัติของบริการหลักใน Azure Active Directory

วิธีการเปลี่ยนคุณสมบัติของบริการหลัก

หากต้องการเปลี่ยนคุณสมบัติของบริการหลักใน Office 365 ให้ใช้คำสั่ง Set-MsolServicePrincipal ใน PowerShell

# Get the service principal ID
$AppId = (Get-MsolServicePrincipal -ServicePrincipalName "ShellGeekApp/ShellApp.com").AppPrincipalId

# Update the service principal name and display name of service principal
Set-MsolServicePrincipal -AppPrincipalId $AppId -DisplayName "Shell Geek Application" -ServicePrincipalNames @("ShellGeekApp/ShellApp.com", "Shell Geek App")  

Get-MsolServicePrincipal cmdlet ใน PowerShell รับรหัสแอปพลิเคชันของชื่อบริการหลักและจัดเก็บไว้ในตัวแปร $AppId

คำสั่ง Set-MsolServicePrincipal ใช้พารามิเตอร์ -AppPrincipalId เพื่อระบุ ID แอปพลิเคชันและอัปเดตชื่อที่แสดงและชื่อหลักของบริการ

การเปลี่ยนแปลงนี้จะเขียนทับการตั้งค่าก่อนหน้าบนบริการหลักใน Azure Active Directory

วิธีการเปลี่ยนที่อยู่ในบริการหลัก

หากต้องการเปลี่ยนที่อยู่ในบริการหลัก ให้ใช้ Set-MsolServicePrincipal cmdlet พร้อมด้วยพารามิเตอร์ -Addresses

พารามิเตอร์ -Addresses ระบุรายการที่อยู่ที่จะอัปเดตและเขียนทับรายการที่มีอยู่

$AppId = (Get-MsolServicePrincipal -ServicePrincipalName "ShellGeekApp").AppPrincipalId
$a = @()
$a = $a + (Get-MsolServicePrincipal -ServicePrincipalName "ShellGeekApp").Addresses
$a = $a + (New-MsolServicePrincipalAddresses -Value "ShellApp1.com")
$a = $a + (New-MsolServicePrincipalAddresses -Value "ShellApp2.com")
Set-MsolServicePrincipal -AppPrincipalId $AppId -Addresses $a

คำสั่งนี้จะอัปเดตที่อยู่ของบริการหลัก “ShellGeekApp“

บทสรุป

ฉันหวังว่าบทความข้างต้นเกี่ยวกับวิธีใช้ Set-MsolServicePrincipal cmdlet ใน PowerShell เพื่ออัปเดตคุณสมบัติบนบริการหลักจะเป็นประโยชน์สำหรับคุณ

คุณสามารถค้นหาหัวข้อเพิ่มเติมเกี่ยวกับคำสั่ง PowerShell Active Directory และพื้นฐานของ PowerShell ได้ในหน้าแรกของ ShellGeek

ลิงก์ที่เกี่ยวข้อง

ใหม่-MsolServicePrincipal

เอา MsolServicePrincipal

รับ-MsolServicePrincipal

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