sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Connect-SPOService: Object reference not set to an instance of an object.

Open SimonSimCity opened this issue 1 year ago • 59 comments

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

other (enter in the "Additional environment details" area below)

Developer environment

macOS

What browser(s) / client(s) have you tested

  • [ ] 💥 Internet Explorer
  • [ ] 💥 Microsoft Edge
  • [ ] 💥 Google Chrome
  • [ ] 💥 FireFox
  • [ ] 💥 Safari
  • [ ] mobile (iOS/iPadOS)
  • [ ] mobile (Android)
  • [X] not applicable
  • [ ] other (enter in the "Additional environment details" area below)

Additional environment details

PowerShell module Microsoft.Online.SharePoint.PowerShell v16.0.24322.12000

Describe the bug / error

I'm currently trying to get started with Sharepoint Embedded (https://learn.microsoft.com/en-us/sharepoint/dev/embedded/mslearn/m02-03-hol). To be able to follow this guide, I joined the Microsoft developer program (https://developer.microsoft.com/en-us/microsoft-365/dev-program) and tried to connect to the environment created by the assistant there.

I could find the there described option to enable Sharepoint Embedded, but when I tried to create the container type, I should run the command Connect-SPOService which errored by giving me an error message I could not find out what to do next:

Connect-SPOService: Object reference not set to an instance of an object.

As of what I've found online, there seems to be some error in the script provided by this package. I'd love to be able to have a look at the code which you run here, but this doesn't seem to be open source ...

Steps to reproduce

  1. Install-Module -Name Microsoft.Online.SharePoint.PowerShell
  2. Import-Module "Microsoft.Online.SharePoint.PowerShell"
  3. Connect-SPOService -Url "https://******-admin.sharepoint.com"

Expected behavior

Based on the documentation, I should be prompted for my credentials, but I wasn't. I tried to add some parameters, as described in the documentation of the script (https://learn.microsoft.com/en-us/powershell/module/sharepoint-online/connect-sposervice?view=sharepoint-ps). Adding the parameter -credential, as shown in the first example, I was first prompted for my password, but the application then stopped with the same error, after I entered the password.

SimonSimCity avatar Jan 04 '24 17:01 SimonSimCity

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Jan 04 '24 17:01 ghost

Any update on this issue? Am facing the exact same problem

brianavvoka avatar Jan 10 '24 09:01 brianavvoka

@brianavvoka I got it working by running the commands in PowerShell on Windows. But this is just a work-around. A proper fix would be to have it also working on Mac (don't know about Linux).

SimonSimCity avatar Jan 10 '24 12:01 SimonSimCity

@brianavvoka I got it working by running the commands in PowerShell on Windows. But this is just a work-around. A proper fix would be to have it also working on Mac (don't know about Linux).

Same in Linux

jleon1984 avatar Jan 19 '24 08:01 jleon1984

Same here...

cblomart avatar Jan 27 '24 08:01 cblomart

Have the same problem...

rpn-wv avatar Jan 29 '24 10:01 rpn-wv

Same issue on macOS Powershell

FrUct1s avatar Jan 31 '24 10:01 FrUct1s

I can confirm the same problem exists using Microsoft PowerShell on Linux.

nvaert1986 avatar Feb 08 '24 12:02 nvaert1986

Also confirming PowerShell on Linux. I know "Object Reference not set to an Instance of an Object" is an ol' .Net error. Tried installing aspnetcore 8.0. No dice.

Machinethreat avatar Feb 09 '24 18:02 Machinethreat

I can confirm this is still an issue on macOS PowerShell 7.4.1

moisesrodriguez avatar Feb 28 '24 22:02 moisesrodriguez

confirming on debian 12.5 powershell

Connect-SPOService: Object reference not set to an instance of an object.

jmergy avatar Mar 13 '24 23:03 jmergy

confirming on MacOS 14.4 and PowerShell 7.4.1 as of today

Connect-SPOService: Object reference not set to an instance of an object.

Koneisto avatar Mar 14 '24 08:03 Koneisto

MacOS 14.4.1 and PowerShell 7.4.1 Issue still exists. Runs in Win11 Arm64 running in VmWare Fusion on the same device.

SakkeWeb avatar Mar 26 '24 14:03 SakkeWeb

Confirming for MacOS 14.4 (23E214) on MacBook Air M1 (2020) PowerShell Version: 7.4.1

pascalinger avatar Mar 29 '24 17:03 pascalinger

Having the SAME issue with Rocky Linux 9.4 x64 with Powershell Version: 7.4.1

breisig avatar Apr 02 '24 22:04 breisig

Same problem here Macbook M1 Pro Sonoma 14.4.1, powershell version 7.4.1

USRobotics1 avatar Apr 05 '24 12:04 USRobotics1

Hi All,

I too had the same problem when i tried with PS Version 7. I think its with the PS version. When i tried the same with version 5.xxx, it worked. Please refer the screenshot below

image

sudharsank avatar Apr 09 '24 09:04 sudharsank

I'm having the same issue.

Connect-SPOService: Object reference not set to an instance of an object.
PS /root/.local/share/powershell/Modules/Microsoft.Online.SharePoint.PowerShell> $psversiontable

Name                           Value
----                           -----
PSVersion                      7.4.1
PSEdition                      Core
GitCommitId                    7.4.1
OS                             Linux Mint 21.2
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

jeroenst avatar Apr 14 '24 14:04 jeroenst

I am having the same issue. Name Value


PSVersion 7.4.1 PSEdition Core GitCommitId 7.4.1 OS Darwin 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:28:58 PST 2023; root:xnu-10002.81.5~7/RELE… Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

HenningBree avatar Apr 18 '24 21:04 HenningBree

Can anyone help us please , we are also facing same issue

sirishaalurikpmg avatar Apr 29 '24 08:04 sirishaalurikpmg