Set-MsolServicePrincipal - Hizmet Sorumlusunun Özelliklerini Güncelle


PowerShell'deki Set-MsolServicePrincipal cmdlet'i Microsoft Office 365'teki hizmet sorumlusunu günceller.

Microsoft Azure Active Directory'de bir hizmet sorumlusunun özelliklerini değiştirmeye yönelik sözdizimi aşağıda verilmiştir.

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

Bu makalede, Azure Active Directory'de bir hizmet sorumlusunun özelliklerini güncellemek için PowerShell'de Set-MsolServicePrincipal cmdlet'inin nasıl kullanılacağını tartışacağız.

Hizmet Sorumlusunun Özellikleri Nasıl Değiştirilir

Office 365'te bir hizmet sorumlusunun özelliklerini değiştirmek için PowerShell'de Set-MsolServicePrincipal komutunu kullanın.

# 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")  

PowerShell'deki Get-MsolServicePrincipal cmdlet'i, hizmet asıl adının uygulama kimliğini alır ve bunu $AppId değişkeninde saklar.

Set-MsolServicePrincipal komutu, uygulama kimliğini belirtmek için -AppPrincipalId parametresini kullanır ve görünen ad ile hizmet sorumlusu adlarını günceller.

Bu değişiklik, Azure Active Directory'deki hizmet sorumlusundaki önceki ayarların üzerine yazılacaktır.

Hizmet Sorumlusundaki Adresleri Değiştirme

Hizmet sorumlusundaki adresleri değiştirmek için Set-MsolServicePrincipal cmdlet'ini -Addresses parametresiyle birlikte kullanın.

-Adresler parametresi güncellenecek ve mevcut listenin üzerine yazılacak adresler listesini belirtir.

$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

Bu komut, "ShellGeekApp" hizmet sorumlusunun adreslerini günceller.

Çözüm

Hizmet sorumlusundaki özellikleri güncellemek için PowerShell'de Set-MsolServicePrincipal cmdlet'inin nasıl kullanılacağına ilişkin yukarıdaki makalenin size yardımcı olacağını umuyorum.

PowerShell Active Directory komutları ve PowerShell temelleri hakkında daha fazla konuyu ShellGeek ana sayfasında bulabilirsiniz.

İlgili Bağlantılar

Yeni-MsolServicePrincipal

Kaldır-MsolServicePrincipal

Get-MsolServicePrincipal

İlgili makaleler