Creates an access token for the Partner Center API.
New-PCSaToken -CspAppId <String> -CspDomain <String> -Credential <PSCredential> [<CommonParameters>]
New-PCSaToken -CspAppId <String> -CspDomain <String> -CspClientSecret <SecureString> [<CommonParameters>]
The New-PCSaToken cmdlet returns a token used the access Partner Center resources.
Specifies a application Id generated for the Partner Center account. The application id must match the authentication type chosen.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
Specifies the Partner Center tenant (onmicrosoft.com) domain.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
Specifies an application secret key generated from the Partner Center portal.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
Specifies the user account credentials to use to perform this task. To specify this parameter, you can type a user name, such as User1 or Domain01\User01 or you can specify a PSCredential object. If you specify a user name for this parameter, the cmdlet prompts for a password. You can also create a PSCredential object by using a script or by using the Get-Credential cmdlet. You can then set the Credential parameter to the PSCredential object.
Required? true
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
$cred = Get-Credential clientSecret = 'NQSm6Wjsd7PcDeP5JD6arEWMF3UghEpWmphGrshxzsQ=' $ClientSecretSecure = $clientSecret | ConvertTo-SecureString -AsPlainText -Force
Creates a new token using the specified information.
PS C:\>$sat = New-PCSaToken -CspAppId 97037612-799c-4fa6-8c40-68be72c6b83c -CspDomain contoso.onmicrosoft.com -CspClientSecret $ClientSecretSecure -Credential $cred
Set a specific token for a command/function - user authentication ##
$cred = Get-Credential
New-PCSaToken -CspAppId '<native app id GUID>' -CspDomain '<csp partner domain>' -Credential $cred
Set a specific token for a command/function - app authentication ##
$clientSecret = '<key code secret>'
$clientSecretSecure = $clientSecret | ConvertTo-SecureString -AsPlainText -Force
New-PCSaToken -CspAppId '<native app id GUID>' -CspDomain '<csp partner domain>' -CspClientSecret $clientSecretSecure