Edit

Update-AzADServicePrincipal

Updates an existing Microsoft Entra service principal.

Syntax

SpObjectIdWithDisplayNameParameterSet (Default)

Update-AzADServicePrincipal
    -ObjectId <Guid>
    [-DisplayName <String>]
    [-Homepage <String>]
    [-IdentifierUri <String[]>]
    [-KeyCredential <KeyCredential[]>]
    [-PasswordCredential <PasswordCredential[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SpApplicationIdWithDisplayNameParameterSet

Update-AzADServicePrincipal
    -ApplicationId <Guid>
    [-Homepage <String>]
    [-IdentifierUri <String[]>]
    [-KeyCredential <KeyCredential[]>]
    [-PasswordCredential <PasswordCredential[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SPNWithDisplayNameParameterSet

Update-AzADServicePrincipal
    -ServicePrincipalName <String>
    [-DisplayName <String>]
    [-Homepage <String>]
    [-IdentifierUri <String[]>]
    [-KeyCredential <KeyCredential[]>]
    [-PasswordCredential <PasswordCredential[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

InputObjectWithDisplayNameParameterSet

Update-AzADServicePrincipal
    -InputObject <PSADServicePrincipal>
    [-DisplayName <String>]
    [-Homepage <String>]
    [-IdentifierUri <String[]>]
    [-KeyCredential <KeyCredential[]>]
    [-PasswordCredential <PasswordCredential[]>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Updates an existing Microsoft Entra service principal. To update the credentials associated with this service principal, please use New-AzADSpCredential cmdlet. To update the properties associated with the underlying application, please use Update-AzADApplication cmdlet.

Examples

Example 1 - Update the display name of a service principal

PS C:\> Update-AzADServicePrincipal -ObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb -DisplayName MyNewDisplayName

Updates the display name of the service principal with object id 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' to be 'MyNewDisplayName'.

Example 2 - Update the display name of a service principal using piping

PS C:\> Get-AzADServicePrincipal -ObjectId aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb | Update-AzADServicePrincipal -DisplayName MyNewDisplayName

Gets the service principal with object id 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' and pipes that to the Update-AzADServicePrincipal cmdlet to update the display name of the service principal to "MyNewDisplayName".

Parameters

-ApplicationId

The application id of the service principal to update.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SpApplicationIdWithDisplayNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisplayName

The display name for the service principal.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SpObjectIdWithDisplayNameParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False
SPNWithDisplayNameParameterSet
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Homepage

The homepage for the service principal.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IdentifierUri

The identifier URI(s) for the service principal.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

The object representing the service principal to update.

Parameter properties

Type:PSADServicePrincipal
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

InputObjectWithDisplayNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-KeyCredential

The key credential(s) for the service principal.

Parameter properties

Type:

KeyCredential[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ObjectId

The object id of the service principal to update.

Parameter properties

Type:Guid
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ServicePrincipalObjectId

Parameter sets

SpObjectIdWithDisplayNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PasswordCredential

The password credential(s) for the service principal.

Parameter properties

Type:

PasswordCredential[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ServicePrincipalName

The SPN of the service principal to update.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SPN

Parameter sets

SPNWithDisplayNameParameterSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Guid

String

PSADServicePrincipal

Parameters: InputObject (ByValue)

Outputs

PSADServicePrincipal