Forum Discussion
Unable to run set-sposite -Disablesharingfornonowners
reshmeeauckloo Are you trying it using both SPO PowerShell and PnP PowerShell?
Error message you shared is for PnP PowerShell. Is it throwing same error using SPO PowerShell as well?
Make sure you are using SharePoint Online Management Shell Version 16.0.4613.1211 or later while using SPO PowerShell.
Example:
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/mysite -DisableSharingForNonOwners
Documentation: Set-SPOSite
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- ganeshsanapJan 30, 2024MVP
reshmeeauckloo Great, glad it worked using latest version of SPO PowerShell.
Maybe something changed in SharePoint backend which is not yet updated in PnP PowerShell command. So I will suggest you to raise a new issue at: PnP PowerShell Issues.
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- reshmeeaucklooJan 30, 2024Brass ContributorYeah I did raise it with PnP PowerShell and we agreed it is something with SP CSOM and closed the ticket. I need to try it with the latest nightly build before raising it back again if it is still an issue. Thanks very much for your help on this ganeshsanap.