Get PnP PowerShell to connect to my Sharepoint online tenant

nader hadjebi 21 Reputation points
2021-07-12T01:06:23.993+00:00

I get the following error "Connect-PnPOnline : The Login server cannot issue the requested compact encrypted ticket because a Data Encryption Key (DEK) has not been uploaded to the site." when I try to connect my Sharepoint Online tenant with PnP PowerShell. Any ideas how to solve this problem?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,940 questions
0 comments No comments
{count} votes

Accepted answer
  1. nader hadjebi 76 Reputation points
    2021-07-18T20:24:50.253+00:00

    I did some trouble shooting and resolved the error that was being generated on sign in.
    The error was: "error-->

    "Connect-PnPOnline : AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000003-0000-0ff1-ce00-000000000000'."

    I created another account for PnPPowershell usage with different authentication and it is working now.
    115607-pnlistsuccess.gif


2 additional answers

Sort by: Most helpful
  1. CaseyYang-MSFT 10,451 Reputation points
    2021-07-12T07:22:55.213+00:00

    Hi @nader hadjebi ,

    Users might get that error if they are not global admin. Please check your account roles.
    Microsoft 365 admin center > Users > Active users > click user name > Roles
    113680-1.png

    And have you check you PowerShell codes? you could try the following PnP PowerShell codes to check wether you still get this error.
    PnP PowerShell codes:

    $SiteURL="https://tenant-admin.sharepoint.com/"  
    $UserName="your user name"  
    $Password = "your password"  
       
    $SecurePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force  
    $Cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword  
       
    #Connect to PNP Online  
    Connect-PnPOnline -Url $SiteURL -Credentials $Cred  
    

    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 person found this answer helpful.

  2. nader hadjebi 76 Reputation points
    2021-07-13T04:03:39.703+00:00

    I just had success connecting using a different powershell
    Connect-SPOService -url https://mysiteurl-admin.sharepoint.com
    I will be working on my follow on tasks tomorrow and will only then know if I run across any issues. So far so good. If there will be a need for a follow up post I will post one, but this new powershell script appears to have answered my question.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.