2017-07-28 02:58:33 +03:00
---
2016-12-01 20:36:07 +03:00
external help file: Microsoft.Open.AzureAD16.Graph.PowerShell.dll-Help.xml
2020-09-18 18:44:11 +03:00
Module Name: AzureAD
online version:
2016-10-19 02:19:16 +03:00
schema: 2.0.0
---
# New-AzureADServicePrincipal
## SYNOPSIS
2016-12-01 20:36:07 +03:00
Creates a service principal.
2016-10-19 02:19:16 +03:00
## SYNTAX
```
2017-02-04 03:05:42 +03:00
New-AzureADServicePrincipal [-AccountEnabled < String > ]
[-AlternativeNames < System.Collections.Generic.List ` 1 [ System . String ] > ] -AppId < String >
[-AppRoleAssignmentRequired < Boolean > ] [-DisplayName < String > ] [-ErrorUrl < String > ] [-Homepage < String > ]
2016-12-01 20:36:07 +03:00
[-KeyCredentials < System.Collections.Generic.List ` 1 [ Microsoft . Open . AzureAD . Model . KeyCredential ] > ]
[-LogoutUrl < String > ]
[-PasswordCredentials < System.Collections.Generic.List ` 1 [ Microsoft . Open . AzureAD . Model . PasswordCredential ] > ]
2017-02-04 03:05:42 +03:00
[-PublisherName < String > ] [-ReplyUrls < System.Collections.Generic.List ` 1 [ System . String ] > ]
2016-12-01 20:36:07 +03:00
[-SamlMetadataUrl < String > ] [-ServicePrincipalNames < System.Collections.Generic.List ` 1 [ System . String ] > ]
2017-02-04 03:05:42 +03:00
[-ServicePrincipalType < String > ] [-Tags < System.Collections.Generic.List ` 1 [ System . String ] > ]
[< CommonParameters > ]
2016-10-19 02:19:16 +03:00
```
## DESCRIPTION
## EXAMPLES
2016-12-01 20:36:07 +03:00
### Example 1: Create a service principal
2016-11-19 20:55:01 +03:00
```
2017-03-17 18:37:56 +03:00
PS C:\>New-AzureADServicePrincipal -AccountEnabled $true -AppId $MyApp.AppId -AppRoleAssignmentRequired $true -DisplayName $App -Tags {WindowsAzureActiveDirectoryIntegratedApp}
2016-10-19 02:19:16 +03:00
```
2020-09-18 18:44:11 +03:00
This command creates a service principal.
2021-06-02 18:19:47 +03:00
The tag "-Tags {WindowsAzureActiveDirectoryIntegratedApp}" is used to have this service principal show up in the list of Integrated Applications in the Admin Portal.
2016-12-01 20:36:07 +03:00
2016-11-19 20:55:01 +03:00
## PARAMETERS
2016-11-02 02:00:44 +03:00
2016-11-19 20:55:01 +03:00
### -AccountEnabled
2017-02-04 03:05:42 +03:00
true if the service principal account is enabled; otherwise, false.
2016-11-02 02:00:44 +03:00
```yaml
2016-11-19 20:55:01 +03:00
Type: String
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2017-02-04 03:05:42 +03:00
### -AlternativeNames
2021-11-15 21:06:33 +03:00
The alternative names for this service principal
2017-02-04 03:05:42 +03:00
```yaml
Type: System.Collections.Generic.List`1[System.String]
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2017-02-04 03:05:42 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-11-19 20:55:01 +03:00
### -AppId
2017-02-04 03:05:42 +03:00
The unique identifier for the associated application (its appId property).
2020-09-18 18:44:11 +03:00
2016-11-02 02:00:44 +03:00
```yaml
2016-10-19 02:19:16 +03:00
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
2016-11-19 20:55:01 +03:00
Required: True
2016-10-19 02:19:16 +03:00
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-11-19 20:55:01 +03:00
### -AppRoleAssignmentRequired
2016-12-01 20:36:07 +03:00
Indicates whether an application role assignment is required.
2016-10-19 02:19:16 +03:00
```yaml
2016-12-01 20:36:07 +03:00
Type: Boolean
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-11-19 20:55:01 +03:00
### -DisplayName
2016-12-01 20:36:07 +03:00
Specifies the display name.
2016-10-19 02:19:16 +03:00
```yaml
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
2016-11-19 20:55:01 +03:00
Required: False
2016-10-19 02:19:16 +03:00
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-11-19 20:55:01 +03:00
### -ErrorUrl
2016-12-01 20:36:07 +03:00
Specifies the error URL.
2016-10-19 02:19:16 +03:00
```yaml
2016-11-19 20:55:01 +03:00
Type: String
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-11-19 20:55:01 +03:00
### -Homepage
2016-12-01 20:36:07 +03:00
Specifies the home page.
2016-10-19 02:19:16 +03:00
```yaml
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-12-01 20:36:07 +03:00
### -KeyCredentials
2017-02-04 03:05:42 +03:00
The collection of key credentials associated with the service principal.
2016-10-19 02:19:16 +03:00
```yaml
2016-12-01 20:36:07 +03:00
Type: System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.KeyCredential]
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -LogoutUrl
2016-12-01 20:36:07 +03:00
Specifies the logout URL.
2020-09-18 18:44:11 +03:00
2016-10-19 02:19:16 +03:00
```yaml
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -PasswordCredentials
2016-12-01 20:36:07 +03:00
Specifies password credentials.
2016-10-19 02:19:16 +03:00
```yaml
2016-12-01 20:36:07 +03:00
Type: System.Collections.Generic.List`1[Microsoft.Open.AzureAD.Model.PasswordCredential]
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -PublisherName
2016-12-01 20:36:07 +03:00
Specifies the publisher name.
2016-10-19 02:19:16 +03:00
```yaml
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2017-02-04 03:05:42 +03:00
### -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.
2016-10-19 02:19:16 +03:00
```yaml
2016-12-01 20:36:07 +03:00
Type: System.Collections.Generic.List`1[System.String]
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -SamlMetadataUrl
2017-02-04 03:05:42 +03:00
The URL for the SAML metadata
2016-10-19 02:19:16 +03:00
```yaml
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ServicePrincipalNames
2020-09-18 18:44:11 +03:00
Specifies an array of service principal names.
Based on the identifierURIs collection, plus the application's appId property, these URIs are used to reference an application's service principal.
A client will use these to:
2017-02-04 03:05:42 +03:00
2020-09-18 18:44:11 +03:00
- populate requiredResourceAccess, via "Permissions to other applications" in the Azure classic portal. - specify a resource URI to acquire an access token, which is the URI returned in the claim.
2016-10-19 02:19:16 +03:00
```yaml
2016-12-01 20:36:07 +03:00
Type: System.Collections.Generic.List`1[System.String]
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2017-02-04 03:05:42 +03:00
### -ServicePrincipalType
THe type of the service principal
```yaml
Type: String
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2017-02-04 03:05:42 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-10-19 02:19:16 +03:00
### -Tags
2017-03-17 18:37:56 +03:00
Tags linked to this service principal.
2020-09-18 18:44:11 +03:00
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}
2017-03-17 18:37:56 +03:00
2016-10-19 02:19:16 +03:00
```yaml
2016-12-01 20:36:07 +03:00
Type: System.Collections.Generic.List`1[System.String]
2016-10-19 02:19:16 +03:00
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
2016-12-01 20:36:07 +03:00
### CommonParameters
2020-09-18 18:44:11 +03:00
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters ](http://go.microsoft.com/fwlink/?LinkID=113216 ).
2016-12-01 20:36:07 +03:00
2023-12-16 17:32:35 +03:00
## NOTES
See the [migration guide for New-AzureADServicePrincipal ](./migrate/New-AzureADServicePrincipal.md ) to the Microsoft Graph PowerShell.
2016-10-19 02:19:16 +03:00
## INPUTS
## OUTPUTS
## RELATED LINKS
2016-11-19 20:55:01 +03:00
2023-12-16 17:32:35 +03:00
[Get-AzureADServicePrincipal ](Get-AzureADServicePrincipal.md )
2020-09-18 18:44:11 +03:00
2023-12-16 17:32:35 +03:00
[Remove-AzureADServicePrincipal ](Remove-AzureADServicePrincipal.md )
2016-12-01 20:36:07 +03:00
2023-12-16 17:32:35 +03:00
[Set-AzureADServicePrincipal ](Set-AzureADServicePrincipal.md )
2016-12-01 20:36:07 +03:00