getting error during add theme in sharepoint online using PowerShell scripts

Khushi 0 Reputation points
2023-11-07T03:45:51.9+00:00

Hi,

I want to add theme in sharepoint online using this Connect-PnPOnline -Url. but getting error as attached below .I have already enabled mfa for my account but during run the command there is no prompt in mfa and facing this issue. User's image

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,726 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,995 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,615 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 35,711 Reputation points Microsoft Vendor
    2023-11-08T01:14:09.15+00:00

    Hi @Khushi,

    As MFA is enabled for user account, you have below two options while authenticating using Connect-PnPOnline:

    1. Use -Interactive (previously UseWebLogin):
    Connect-PnPOnline -Url https://******.sharepoint.com/ -Interactive
    

    Use App Password for Office 365:

    You can use App password in place of normal password to login easily.

    I am using App Password for authentication in PowerShell as well as SharePoint Designer and it works well.

    Create an app password for Office 365.

    You can find more details in below threads:

    1. Connect-SPOService : The sign-in name or password does not match one in the Microsoft account system
    2. The sign-in name or password does not match one in the Microsoft account system

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    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.


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.