Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Set-PnPHomeSite throws an error when you have multiple Viva Connections #3978

Closed
1 of 6 tasks
ryder-cayden opened this issue May 27, 2024 · 6 comments · Fixed by #3986
Closed
1 of 6 tasks

[BUG] Set-PnPHomeSite throws an error when you have multiple Viva Connections #3978

ryder-cayden opened this issue May 27, 2024 · 6 comments · Fixed by #3986
Assignees
Labels
bug Something isn't working

Comments

@ryder-cayden
Copy link

Reporting an Issue

Running the Set-PnPHomeSite when you have multiple Viva Connections throws the following error:
"Set-PnPHomeSite: Operation is not valid due to the current state of the object."

Expected behavior

The Home site should be configured without any error.

Actual behavior

There is an error when running that cmdlet

Steps to reproduce behavior

  1. Go to Office 365 admin center -> Settings -> Viva -> Viva connections
  2. Ensure you have multiple Viva Connections. In my case I have the following:
  1. Open up PowerShell and run the following command:
    Set-PnpHomeSite -HomeSiteUrl https://tenantName.sharepoint.com/sites/intranet
    (please change the HomeSiteUrl parameter accordingly)
  2. The following exception will be thrown:
    Set-PnPHomeSite: Operation is not valid due to the current state of the object.

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

2.3.0 and 2.4.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@ryder-cayden ryder-cayden added the bug Something isn't working label May 27, 2024
@reshmee011
Copy link
Contributor

Hi @ryder-cayden
By any chance are you able to use SharePoint Online PowerShell cmdlet Set-SPOHomeSite to set the Home Site? If yes , can please confirm whether you get the same error as using set-pnphomesite?

@ryder-cayden
Copy link
Author

Hi @reshmee011... The Set-SPOHomeSite works fine based on my testing. I did not get the same error.

@reshmee011
Copy link
Contributor

I could reproduce the issue with set-pnphomesite. I checked the code, nothing unusual. It used to work in the past. I will try to find out why it is not working.

@gautamdsheth gautamdsheth self-assigned this May 30, 2024
@gautamdsheth
Copy link
Collaborator

@reshmee011 - found a fix for this , will PR as well shortly. Ran into this while working for a customer project, sorry 😟

@gautamdsheth
Copy link
Collaborator

@reshmee011 @ryder-cayden - this issue has been fixed now. Will be available in tomorrow's nightly builds and the next major one when we release it. Thanks for reporting and looking into it.

@reshmee011
Copy link
Contributor

Thanks so much @gautamdsheth for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants