Set-AzureADMSServicePrincipal

Updates a service principal.

Syntax

Set-AzureADMSServicePrincipal
   -Id <String>
   [-AccountEnabled <String>]
   [-AppId <String>]
   [-AppRoleAssignmentRequired <Boolean>]
   [-CustomSecurityAttributes <Object>]
   [-DisplayName <String>]
   [-ErrorUrl <String>]
   [-LogoutUrl <String>]
   [-Homepage <String>]
   [-SamlMetadataUrl <String>]
   [-MicrosoftFirstParty <Boolean>]
   [-PublisherName <String>]
   [-PreferredTokenSigningKeyThumbprint <String>]
   [-ReplyUrls <System.Collections.Generic.List`1[System.String]>]
   [-ServicePrincipalNames <System.Collections.Generic.List`1[System.String]>]
   [-Tags <System.Collections.Generic.List`1[System.String]>]
   [-KeyCredentials <System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.MsKeyCredential]>]
   [-PasswordCredentials <System.Collections.Generic.List`1[Microsoft.Open.MSGraph.Model.MsPasswordCredential]>]
   [<CommonParameters>]

Description

Updates a service principal in Azure Active Directory (Azure AD).

Examples

Example 1

PS C:\> Set-AzureADMSServicePrincipal -Id 2e0d8ca7-57d1-4a87-9c2a-b3638a4cadbf -AccountEnabled $False

This command disables the account of the specified service principal.

Example 2

PS C:\> $attributes = @{
    Engineering = @{
        "@odata.type" = "#Microsoft.DirectoryServices.CustomSecurityAttributeValue"
        "Project@odata.type" = "#Collection(String)"
        Project = @("Baker","Cascade")
    }
}
PS C:\> Set-AzureADMSServicePrincipal -Id 7d194b0c-bf17-40ff-9f7f-4b671de8dc20 -CustomSecurityAttributes $attributes

Assign a custom security attribute with a multi-string value to an application (service principal).

  • Attribute set: Engineering
  • Attribute: Project
  • Attribute data type: Collection of Strings
  • Attribute value: ("Baker","Cascade")

Example 3

PS C:\> $attributesUpdate = @{
    Engineering = @{
        "@odata.type" = "#Microsoft.DirectoryServices.CustomSecurityAttributeValue"
        "Project@odata.type" = "#Collection(String)"
        Project = @("Alpine","Baker")
    }
}
PS C:\> Set-AzureADMSServicePrincipal -Id 7d194b0c-bf17-40ff-9f7f-4b671de8dc20 -CustomSecurityAttributes $attributesUpdate

Update a custom security attribute with a multi-string value for an application (service principal).

  • Attribute set: Engineering
  • Attribute: Project
  • Attribute data type: Collection of Strings
  • Attribute value: ("Alpine","Baker")

Parameters

-AccountEnabled

Indicates whether the account is enabled.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppId

Specifies the application ID.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppRoleAssignmentRequired

Indicates whether an application role assignment is required.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomSecurityAttributes

Custom security attributes for the service principal.

Type:Object
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

Specifies the display name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ErrorUrl

Specifies the error URL.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Homepage

Specifies the home page.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Specifies the ID of a service principal in Azure AD.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-KeyCredentials

Specifies key credentials.

Type:List<T>[Microsoft.Open.MSGraph.Model.MsKeyCredential]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LogoutUrl

Specifies the logout URL.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MicrosoftFirstParty

Indicates whether the service principal is for a Microsoft first-party app.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PasswordCredentials

Specifies password credentials.

Type:List<T>[Microsoft.Open.MSGraph.Model.MsPasswordCredential]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PreferredTokenSigningKeyThumbprint

Preferred token signing key thumbprint for the service principal.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PublisherName

Specifies the publisher name.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReplyUrls

The URLs that user tokens are sent to for sign in with the associated application, or the redirect URIs that OAuth 2.0 authorization codes and access tokens are sent to for the associated application.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SamlMetadataUrl

@{Text=}

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ServicePrincipalNames

Specifies service principal names.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Tags

Specifies an array of tags. Note that if you intend for this service principal to show up in the All Applications list in the admin portal, you need to set this value to {WindowsAzureActiveDirectoryIntegratedApp}

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

Object