Show / Hide Table of Contents

    Register-PnPManagementShellAccess

    SYNOPSIS

    Registers access to the tenant for the PnP Management Shell Multi-Tenant Azure AD Application

    SYNTAX

    Main

    Register-PnPManagementShellAccess [-AzureEnvironment <AzureEnvironment>] [<CommonParameters>]
    

    Show Consent Url

    Register-PnPManagementShellAccess -ShowConsentUrl [-AzureEnvironment]
    

    DESCRIPTION

    This cmdlet grants access to the tenant for the PnP Management Shell Multi-Tenant Azure AD Application which simplifies the use of OAuth based access for PnP PowerShell when using credentials to authenticate. If you are not an administrator that can consent Azure AD Applications, use the -ShowConsentUrl option. It will ask you to log in and provides you with an URL you can share with a person with appropriate access rights to provide consent for the organization.

    EXAMPLES

    EXAMPLE 1

    Register-PnPManagementShellAccess
    

    EXAMPLE 2

    Register-PnPManagementShellAccess -ShowConsentUrl
    

    Launches the consent flow to grant the PnP Management Shell Azure AD Application delegate access to the tenant and also displays the consent URL which can be shared with Azure AD administrators or Global administrators.

    EXAMPLE 3

    Register-PnPManagementShellAccess -ShowConsentUrl -TenantName yourtenant.onmicrosoft.com
    

    Displays the consent URL which can be shared with Azure AD administrators or Global administrators.

    PARAMETERS

    -ShowConsentUrl

    If specified you will be asked to authenticate to acquire the tenant id. An url that can be used to provide consent will be returned.

    Type: SwitchParameter
    Parameter Sets: Show Consent Url
    
    Required: False
    Position: Named
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -AzureEnvironment

    The Azure environment to use for authentication, the defaults to 'Production' which is the main Azure environment.

    Type: AzureEnvironment
    Parameter Sets: (All)
    Accepted values: Production, PPE, China, Germany, USGovernment
    Required: False
    Position: Named
    Default value: Production
    Accept pipeline input: False
    Accept wildcard characters: False
    

    -TenantName

    The name of the tenant. Example - ( yourtenant.onmicrosoft.com)

    Type: SwitchParameter
    Parameter Sets: Show Consent Url
    
    Required: False
    Position: Named
    Accept pipeline input: False
    Accept wildcard characters: False
    

    RELATED LINKS

    Microsoft 365 Patterns and Practices

    Back to top Generated by DocFX spacer