Forum Discussion
reshmeeauckloo
Jan 29, 2024Brass Contributor
Unable to run set-sposite -Disablesharingfornonowners
Running the SPO PowerShell ```PowerShell $AdminSiteURL= "https://reshmeeauckloo-admin.sharepoint.com" $SiteURL= "https://reshmeeauckloo.sharepoint.com/sites/testclone2" #Connect to SharePoint O...
ganeshsanap
Jan 29, 2024MVP
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.
reshmeeauckloo
Jan 30, 2024Brass Contributor
Upgrading SPO PowerShell to the latest resolved the issue. I could reproduce the issue with both PnP PowerShell and SPO PowerShell. I could still reproduce the issue with PnP PowerShell.