Connecting with PnP PowerShell(without username and password)

Sezgin Tabak 86 Reputation points

Dear Sir or Madam,

Is it possible to connect a site of SharePoint without creditiantials(Username, Password, pre-stored credentials using the Secrets Management, Ref. Link: )? Because I have required permissions for Azure AD App.

Kind Regards,
Sezgin Tabak

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,743 questions
Azure IoT Plug and Play
Azure IoT Plug and Play
A Microsoft technology based on an open modeling language that enables developers to connect internet of things (IoT) devices to the cloud without having to write any code.
10 questions
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
7,073 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael 17,921 Reputation points

    Hi @Sezgin Tabak ,

    You could use AAD App for authentication with PnP PowerShell, you could refer to this documentation:

    In Azure AD when doing app-only you typically use a certificate to request access: anyone having the certificate and its private key can use the app and the permissions granted to the app. So you have to create and configure a self-signed X.509 certificate, which will be used to authenticate your Application against Azure AD, while requesting the App Only access token.

    The cmdlet is like the following:

    Connect-PnPOnline -ClientId <$application client id as copied over from the AAD app registration above> -CertificatePath '<$path to the PFX file generated by the PowerShell script above>' -CertificatePassword (ConvertTo-SecureString -AsPlainText "<$password assigned to the generated certificate pair above>" -Force) -Url https://<$yourtenant> -Tenant "<$tenantname>"  

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

1 additional answer

Sort by: Most helpful
  1. Arijit_cloud 1 Reputation point Microsoft Employee

    The following are the some of the ways to connect to SharePoint,

    1. Using a certificate
    2. Using Azure ad app id and secret
    3. Prompt user name password (It will open a pop up for login credentials)

    Now I understand you have an azure ad app, you should be able to connect, using Client id and secret, please have a look here
    Connect-PnPOnline -Url "" -ClientId 344b8aab-389c-4e4a-8fa1-4c1ae2c0a60d -ClientSecret $clientSecret

    Connect-PnPOnline options Reference