Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

MFA and Connect-PnPOnline -PnPO365ManagementShell Errors with Object reference not set to an instance of an object #1621

@pmatthews05

Description

@pmatthews05

Reporting an Issue or Missing Feature

Error

Expected behavior

Connect to SharePoint using an account with MFA user and the -PnPO365ManagementShell

Actual behavior

After authenticating, I get an Object reference not set to an instance of an object error message.

Steps to reproduce behavior

  • With my Powershell window I type in
    Connect-PnPOnline -PnPO365ManagementShell:$true -Url:https://mytestsite.sharepoint.com/sites/June -ReturnConnection:$true -LaunchBrowser:$true

  • The device Login page appears, I paste the code in

  • The Window displays PnP Office 365 Management Shell, clicked Continue.

  • Pick an account - I pick my account, enter UserName and Password, run through my MFA step

  • The powershell windows says Token Received, followed by

Connect-PnPOnline : Object reference not set to an instance of an object.
At line:1 char:1
+ Connect-PnPOnline -PnPO365ManagementShell:$true -Url:https://mytestsite ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Connect-PnPOnline], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,SharePointPnP.PowerShell.Commands.Base.ConnectOnline

Screenshot included
connect-pnponlineerror

Which version of the PnP-PowerShell Cmdlets are you using?

  • PnP PowerShell for SharePoint 2013
  • PnP PowerShell for SharePoint 2016
  • PnP PowerShell for SharePoint Online

What is the version of the Cmdlet module you are running?

2.27.1806.1

How did you install the PnP-PowerShell Cmdlets?

  • Other means - Upgrade-Module SharePointPnPPowerShell*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions