Expand Minimize
This topic has not yet been rated - Rate this topic

Set-MsolServicePrincipal

Published: April 18, 2013

Updated: April 19, 2013

Applies To: Office 365, Windows Azure Active Directory, Windows Intune

noteNote
  • This topic provides online help content that is applicable to multiple Microsoft cloud services, including Windows Intune and Office 365.

  • The Windows Azure Active Directory Module for Windows PowerShell cmdlets were previously known as the Microsoft Online Services Module for Windows PowerShell cmdlets.

The Set-MsolServicePrincipal cmdlet updates a service principal in Windows Azure Active Directory. It can be used to update the display name, enable/disable the service principal, trusted for delegation, the service principal names (SPNs) or the addresses.

Syntax

Set-MsolServicePrincipal [-AccountEnabled <Boolean>] [-Addresses <Address[]>] [-DisplayName <string>] [-ServicePrincipalNames <string[]>] [-TenantId <Guid>] [<CommonParameters>]
Set-MsolServicePrincipal -ObjectId <Guid> [-Addresses <Address[]>] [-ServicePrincipalNames <string[]>] [-TenantId <Guid>] [<CommonParameters>]
Set-MsolServicePrincipal -AppPrincipalId <GUID> [-Addresses <Address[]>] [-ServicePrincipalNames <string[]>] [-TenantId <Guid>] [<CommonParameters>]

Parameters

    -AccountEnabled <Boolean>
        This property is reserved for future use.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -Addresses <Address[]>
        Specify the addresses list to update (and overwrite) the existing list 
        with.  If this is set to NULL, the existing property will not be 
        updated.  If this is set to an empty list, the existing Addresses will 
        be cleared.  Use the New-MsolServicePrincipalAddress cmdlet to help 
        create the Addresses list object.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -AppPrincipalId <GUID>
        The unique application identifier associated with the service 
        principal to be updated.
        
        Required?                    true
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -DisplayName <string>
        The friendly name of the service principal.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    -ObjectId <Guid>
        The object ID associated with the service principal to be updated.
        
        Required?                    true
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -ServicePrincipalNames <string[]>
        Specify the service principal names (SPNs) list to update (and 
        overwrite) the existing list with.  If this is set to NULL, the 
        existing property will not be updated.  If this is set to an empty 
        list, the existing SPNs will be cleared, except for the SPN containing 
        the service principal's AppId value.
        An SPN must use one of the following formats "appName" or 
        "appName/hostname" or be a valid URL.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -TenantId <Guid>
        The unique ID of the tenant to perform the operation on. If this is 
        not provided, then the value will default to the tenant of the current 
        user. This parameter is only applicable to partner users.
        
        Required?                    false
        Position?                    named
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, 
    see 
        about_CommonParameters 
    (http://go.microsoft.com/fwlink/?LinkID=113216).

Examples

The following examples demonstrate the usage of this cmdlet.

Example 1

The following command updates properties on the specified service principal. In this example, it specifies updates to the display name and the service principal names. This will overwrite any previous settings.

$AppId = (Get-MsolServicePrincipal -ServicePrincipalName "MyApp").AppPrincipalId
Set-MsolServicePrincipal -AppPrincipalId $AppId -DisplayName "My Super Application" -ServicePrincipalNames @("MyApp/Contoso.com", "MyApp/Fabrikam.com")

Example 2

The following command updates a service principal's associated addresses. In this example, existing Addresses that were previously created ("Contoso.com", "Fabrikam.com") using the New-MsolServicePrincipalAddress helper command, are associated with the service principal. The following command updates properties on the specified service principal. In this example, it specifies updates to the display name and the service principal names. This will overwrite any previous settings.

$a = @()
$a = $a + (Get-MsolServicePrincipal -ServicePrincipalName "MyApp").Addresses
$a = $a + (New-MsolServicePrincipalAddress -Value "Contoso.com")
$a = $a + (New-MsolServicePrincipalAddress -Value "Fabrikam.com")
Set-MsolServicePrincipal -AppPrincipalId $AppId -Addresses $a

Additional Resources

See Also

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.