content_git_url | external help file | Module Name | online version | original_content_git_url | schema |
---|---|---|---|---|---|
Microsoft.Store.PartnerCenter.PowerShell.dll-Help.xml |
PartnerCenter |
2.0.0 |
Acquires an access token from Azure Active Directory.
New-PartnerAccessToken -AccessToken <String> -ApplicationId <String> [-Credential <PSCredential>]
[-Environment <EnvironmentName>] -Scopes <String[]> [-Tenant <String>] [<CommonParameters>]
New-PartnerAccessToken [-ApplicationId <String>] [-CertificateThumbprint <String>] [-Credential <PSCredential>]
[-Environment <EnvironmentName>] [-Module <ModuleName>] -RefreshToken <String> -Scopes <String[]>
[-ServicePrincipal] [-Tenant <String>] [<CommonParameters>]
New-PartnerAccessToken -ApplicationId <String> -Credential <PSCredential> [-Environment <EnvironmentName>]
-Scopes <String[]> [-ServicePrincipal] -Tenant <String> [-UseAuthorizationCode] [<CommonParameters>]
New-PartnerAccessToken -ApplicationId <String> -CertificateThumbprint <String> [-Environment <EnvironmentName>]
-Scopes <String[]> [-ServicePrincipal] -Tenant <String> [-UseAuthorizationCode] [<CommonParameters>]
New-PartnerAccessToken -ApplicationId <String> [-Environment <EnvironmentName>] -Scopes <String[]>
[-Tenant <String>] [-UseAuthorizationCode] [-UseDeviceAuthentication] [<CommonParameters>]
New-PartnerAccessToken [-Environment <EnvironmentName>] -Module <ModuleName> [-RefreshToken <String>]
[-Tenant <String>] [-UseAuthorizationCode] [<CommonParameters>]
Acquires an access token from Azure Active Directory.
PS C:\> $credential = Get-Credential
PS C:\> New-PartnerAccessToken -ApplicationId 'xxxx-xxxx-xxxx-xxxx' -Scopes 'https://api.partnercenter.microsoft.com/user_impersonation' -ServicePrincipal -Credential $credential -Tenant 'xxxx-xxxx-xxxx-xxxx' -UseAuthorizationCode
The first command gets the service principal credentials (application identifier and service principal secret), and then stores them in the $credential variable. The second command will request a new access token from Azure Active Directory. When using the UseAuthorizationCode
parameter you will be prompted to authentication interactively using the authorization code flow. The redirect URI value will generated dynamically. This generation process will attempt to find a port between 8400 and 8999 that is not in use. Once an available port has been found, the redirect URL value will be constructed (e.g. http://localhost:8400). So, it is important that you have configured the redirect URI value for your Azure Active Directory application accordingly.
PS C:\> $credential = Get-Credential
PS C:\> $refreshToken = '<refreshToken>'
PS C:\> New-PartnerAccessToken -ApplicationId 'xxxx-xxxx-xxxx-xxxx' -Credential $credential -RefreshToken $refreshToken -Scopes 'https://api.partnercenter.microsoft.com/user_impersonation' -ServicePrincipal -Tenant 'xxxx-xxxx-xxxx-xxxx'
The first command gets the service principal credentials (application identifier and service principal secret), and then stores them in the $credential variable. The third command will generate a new access token using the service principal credentials stored in the $credential variable and the refresh token stored in the $refreshToken variable for authentication.
The access token for Partner Center.
Type: String
Parameter Sets: AccessToken
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The application identifier to be used during authentication.
Type: String
Parameter Sets: AccessToken, ServicePrincipal, ServicePrincipalCertificate, User
Aliases: ClientId
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: RefreshToken
Aliases: ClientId
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Certificate Hash (Thumbprint)
Type: String
Parameter Sets: RefreshToken
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: ServicePrincipalCertificate
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Credentials that represents the service principal.
Type: PSCredential
Parameter Sets: AccessToken, RefreshToken
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: PSCredential
Parameter Sets: ServicePrincipal
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The environment use for authentication.
Type: EnvironmentName
Parameter Sets: (All)
Aliases: EnvironmentName
Accepted values: AzureCloud, AzureChinaCloud, AzureGermanCloud, AzurePPE, AzureUSGovernment
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The module that an access token is being generated.
Type: ModuleName
Parameter Sets: RefreshToken
Aliases: ModuleName
Accepted values: ExchangeOnline
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: ModuleName
Parameter Sets: ByModule
Aliases: ModuleName
Accepted values: ExchangeOnline
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The refresh token to use during authentication.
Type: String
Parameter Sets: RefreshToken
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: ByModule
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Scopes requested to access a protected API.
Type: String[]
Parameter Sets: AccessToken, RefreshToken, ServicePrincipal, ServicePrincipalCertificate, User
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Indicates that this account authenticates by providing service principal credentials.
Type: SwitchParameter
Parameter Sets: RefreshToken, ServicePrincipalCertificate
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: SwitchParameter
Parameter Sets: ServicePrincipal
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The identifier of the Azure AD tenant.
Type: String
Parameter Sets: AccessToken, RefreshToken, User, ByModule
Aliases: Domain, TenantId
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Type: String
Parameter Sets: ServicePrincipal, ServicePrincipalCertificate
Aliases: Domain, TenantId
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Use the authorization code flow during authentication.
Type: SwitchParameter
Parameter Sets: ServicePrincipal, ServicePrincipalCertificate, User, ByModule
Aliases: AuthCode
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Use device code authentication instead of a browser control
Type: SwitchParameter
Parameter Sets: User
Aliases: DeviceCode, DeviceAuth, Device
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.