< Back

Connect-PartnerCenter

Sat Jan 18, 2020 6:26 pm

NAME Connect-PartnerCenter



SYNOPSIS

Connect to Partner Center with an authenticated account for use with partner cmdlet requests.





SYNTAX

Connect-PartnerCenter -AccessToken <String> [-EnforceMFA] [-Environment {AzureCloud | AzureChinaCloud |

AzureGermanCloud | AzurePPE | AzureUSGovernment}] [-Tenant <String>] [-Confirm] [-WhatIf] [<CommonParameters>]



Connect-PartnerCenter -ApplicationId <String> [-CertificateThumbprint <String>] [-Credential <PSCredential>]

[-EnforceMFA] [-Environment {AzureCloud | AzureChinaCloud | AzureGermanCloud | AzurePPE | AzureUSGovernment}]

-RefreshToken <String> [-Tenant <String>] [-Confirm] [-WhatIf] [<CommonParameters>]



Connect-PartnerCenter -ApplicationId <String> -CertificateThumbprint <String> [-EnforceMFA] [-Environment

{AzureCloud | AzureChinaCloud | AzureGermanCloud | AzurePPE | AzureUSGovernment}] [-ServicePrincipal] -Tenant

<String> [-Confirm] [-WhatIf] [<CommonParameters>]



Connect-PartnerCenter -Credential <PSCredential> [-EnforceMFA] [-Environment {AzureCloud | AzureChinaCloud |

AzureGermanCloud | AzurePPE | AzureUSGovernment}] -ServicePrincipal -Tenant <String> [-Confirm] [-WhatIf]

[<CommonParameters>]



Connect-PartnerCenter [-EnforceMFA] [-Environment {AzureCloud | AzureChinaCloud | AzureGermanCloud | AzurePPE |

AzureUSGovernment}] [-Tenant <String>] [-UseDeviceAuthentication] [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Connect-PartnerCenter cmdlet connects to Partner Center with an authenticated account for use with partner

cmdlet requests. After executing this cmdlet, you can disconnect from an Partner Center account using

Disconnect-PartnerCenter.





PARAMETERS

-AccessToken <String>

The access token for Partner Center.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ApplicationId <String>

SPN



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CertificateThumbprint <String>

Certificate Hash (Thumbprint)



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

Application identifier and secret for service principal credentials.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EnforceMFA [<SwitchParameter>]

A flag indicating whether or not multi-factor authentication is enforced. The is only configurable while the

Partner Center API is not requiring multi-factor authentication.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Environment <EnvironmentName>

Environment containing the account to log into.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RefreshToken <String>

Refresh token used to connect to Partner Center.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ServicePrincipal [<SwitchParameter>]

Indicates that this account authenticates by providing service principal credentials.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Tenant <String>

The identifier of the Azure AD tenant.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-UseDeviceAuthentication [<SwitchParameter>]

Use device code authentication instead of a browser control



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

Microsoft.Store.PartnerCenter.PowerShell.Models.Authentication.PartnerContext







NOTES









Example 1: Use an interactive login to connect to a Partner Center account



PS C:\\> Connect-PartnerCenter



This command connects to a Partner Center account. To run partner cmdlets with this account, you must provide an

organizational credentials, that are associated with the Cloud Solution Provider program, at the prompt.





Example 2: Connect to Partner Center using a service principal account



PS C:\\> $credential = Get-Credential

PS C:\\> Connect-PartnerCenter -Credential $credential -Tenant 'xxxx-xxxx-xxxx-xxxx' -ServicePrincipal



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 connects to Partner Center using the service

principal credentials stored in $credential for the specified Tenant. The ServicePrincipal switch parameter

indicates that the account authenticates as a service principal.





----- Example 3: Connect to Partner using a refresh token -----



PS C:\\> $refreshToken = '<refreshToken>'

PS C:\\> Connect-PartnerCenter -ApplicationId 'xxxx-xxxx-xxxx-xxxx' -RefreshToken $refreshToken



Connects to Partner Center using a refresh token.







RELATED LINKS

Online Version: https://docs.microsoft.com/powershell/m ... tnerCenter