SOLVED

Onedrive for business prevent resharing by members

Copper Contributor

Hi,

 

We want to prevent members to reshare ODB data.

I have found the following commands online but i'm receiving the following error:

 

Set-SPOTenant : Kan een object van het type System.String niet converteren naar het type Microsoft.Online.SharePoint.TenantAdministration.EsignatureThirdPartyProvidersInfo.
At line:1 char:1
+ Set-SPOTenant -ODBMembersCanShare Off
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-SPOTenant], InvalidCastException
+ FullyQualifiedErrorId : System.InvalidCastException,Microsoft.Online.SharePoint.PowerShell.SetTenant

 

The commands are

# Authorize users to share items from another user's OneDrive (FOR ALL ONEDRIVE)
Set-SPOTenant -ODBMembersCanShare Off #On, Off, Unspecified
# Authorize users to request access or sharing to another user's OneDrive (FOR ALL ONEDRIVE)
Set-SPOTenant -ODBAccessRequests Off #On, Off, Unspecified

6 Replies
Seems to work fine here. Try putting some quotes around the value, i.e. "On". And update your module.
Hi, Thanks for the reply. Can you point what i'm doing wrong.
I run the following commands.

Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Update-Module -Name Microsoft.Online.SharePoint.PowerShell

Connect-SPOService -Url https://mysharepointsitename-admin.sharepoint.com

and then
Set-SPOTenant -ODBMembersCanShare "Off" #On, Off, Unspecified
# Authorize users to request access or sharing to another user's OneDrive (FOR ALL ONEDRIVE)
Set-SPOTenant -ODBAccessRequests Off #On, Off, Unspecified
It looks fine, and as I said, the exact same cmdlets work OK on my end. I run them on Windows PowerShell btw, if you are using Core/7, try switching.
best response confirmed by PepijnDeneut (Copper Contributor)
Solution

@pepijn_deneut @PepijnDeneut 

 

The commands you are using looks fine to me. Is this issue because of the system language?

 

Can you check using PnP PowerShell once?

 

  1. Installing PnP PowerShell 
  2. Set-PnPTenant 

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.

Hi @ganeshsanap,

Thanks, with pnp powershell it works.

I also tried it on a english os.

If you're looking to prevent re sharing on OneDrive for Business, have you checked out the platform's settings or documentation? Meanwhile, have you thought about using Monday project management to keep track of any changes or configurations you make in your OneDrive setup? It could be a great way to ensure smooth operations and organization within your team.

1 best response

Accepted Solutions
best response confirmed by PepijnDeneut (Copper Contributor)
Solution

@pepijn_deneut @PepijnDeneut 

 

The commands you are using looks fine to me. Is this issue because of the system language?

 

Can you check using PnP PowerShell once?

 

  1. Installing PnP PowerShell 
  2. Set-PnPTenant 

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.

View solution in original post