I would like to connect with my PnP-PowerShell-script to online SharePoint that only ask for an email address to logon. How can I do that? Is that Possible?

Greetings, P


Their is no OOTB way but there are different ways to accomplish it. You have to enter the password one time and save it. After that you can use that save credential to login every time. But this method is local to machine, if you try to connect SPO from different machine then it will not work.

  • You have to download Script from Git Hub "v1.0.0 PowerShell Stored Credentials"
  • Now load the script in the Powershell console
  • Simply run New-StoredCredential, this will store the credentials on the path you mentioned.
  • Now run this Get-StoredCredential -UserName "", this will load the credentials for you.

    Connect-MsolService -Credential (Get-StoredCredential -UserName admin@exchangeserverpro.onmicrosoft.com)

Read complete detail here: Saving Credentials for Office 365 PowerShell Scripts and Scheduled Tasks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy