sp-dev-docs
sp-dev-docs copied to clipboard
Connect-SPOService: Object reference not set to an instance of an object.
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
-
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
-
Import-Module "Microsoft.Online.SharePoint.PowerShell"
-
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.
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Any update on this issue? Am facing the exact same problem
@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).
@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
Same here...
Have the same problem...
Same issue on macOS Powershell
I can confirm the same problem exists using Microsoft PowerShell on Linux.
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.
I can confirm this is still an issue on macOS PowerShell 7.4.1
confirming on debian 12.5 powershell
Connect-SPOService: Object reference not set to an instance of an object.
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.
MacOS 14.4.1 and PowerShell 7.4.1 Issue still exists. Runs in Win11 Arm64 running in VmWare Fusion on the same device.
Confirming for MacOS 14.4 (23E214) on MacBook Air M1 (2020) PowerShell Version: 7.4.1
Having the SAME issue with Rocky Linux 9.4 x64 with Powershell Version: 7.4.1
Same problem here Macbook M1 Pro Sonoma 14.4.1, powershell version 7.4.1
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
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
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
Can anyone help us please , we are also facing same issue