Trying to enable a onedrive for external collaboration for single user

Brass Contributor

Hi,

 

I'm trying to enable a OneDrive so it's able to share externally using Powershell however this error keeps popping up: 

 

This wasn't happening before:

Odenkaz_0-1590029282874.png

The error message: 

 

set-sposite : https://contoso-my.sharepoint.com/personal/user_domain_com is a OneDrive for Business site collection. The only valid parameters for this type of site collection are '-Identity',
'-AllowDownloadingNonWebViewableFiles', '-AllowEditing', '-ConditionalAccessPolicy', '-DefaultLinkPermission', '-DefaultSharingLinkType', '-DisableCompanyWideSharingLinks', '-LimitedAccessFileType', '-LockState', '-Owner',
'-SharingAllowedDomainList', '-SharingBlockedDomainList', '-SharingCapability', '-SharingDomainRestrictionMode', '-ShowPeoplePickerSuggestionsForGuestUsers', '-StorageQuota', and '-StorageWarningLevel'.
At line:1 char:1
+ set-sposite https://contoso-my.sharepoint.com/personal/user ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-SPOSite], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSite

 

What I'm trying to do is have a small pilot where only 5 users  can shar externally while the rest of the population has it disabled. 

 

 

The script that i'm using: 

 

 

#Get Credentials to connect

$user = "global admin email";

$pass = "password";

$pwd = ConvertTo-SecureString $pass -AsPlainText -Force;

$credentials = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $user,$pwd;

Connect-SPOService -url https://contoso-admin.sharepoint.com/ -Credential $credentials;

 

Set-SPOSite -Identity https://sontoso-my.sharepoint.com/personal/user_contoso_com  -SharingCapability  ExternalUserAndGuestSharing;

 

 

0 Replies