Trying to enable a onedrive for external collaboration for single user

%3CLINGO-SUB%20id%3D%22lingo-sub-1407328%22%20slang%3D%22en-US%22%3ETrying%20to%20enable%20a%20onedrive%20for%20external%20collaboration%20for%20single%20user%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1407328%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20enable%20a%20OneDrive%20so%20it's%20able%20to%20share%20externally%20using%20Powershell%20however%20this%20error%20keeps%20popping%20up%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EThis%20wasn't%20happening%20before%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Odenkaz_0-1590029282874.png%22%20style%3D%22width%3A%201262px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F193461i041F7BA81E81E55F%2Fimage-dimensions%2F1262x113%3Fv%3D1.0%22%20width%3D%221262%22%20height%3D%22113%22%20title%3D%22Odenkaz_0-1590029282874.png%22%20alt%3D%22Odenkaz_0-1590029282874.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EThe%20error%20message%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eset-sposite%20%3A%20%3CA%20href%3D%22https%3A%2F%2Fdomain-my.sharepoint.com%2Fpersonal%2Fuser_domain_com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fcontoso-my.sharepoint.com%2Fpersonal%2Fuser_domain_com%3C%2FA%3E%20is%20a%20OneDrive%20for%20Business%20site%20collection.%20The%20only%20valid%20parameters%20for%20this%20type%20of%20site%20collection%20are%20'-Identity'%2C%3CBR%20%2F%3E'-AllowDownloadingNonWebViewableFiles'%2C%20'-AllowEditing'%2C%20'-ConditionalAccessPolicy'%2C%20'-DefaultLinkPermission'%2C%20'-DefaultSharingLinkType'%2C%20'-DisableCompanyWideSharingLinks'%2C%20'-LimitedAccessFileType'%2C%20'-LockState'%2C%20'-Owner'%2C%3CBR%20%2F%3E'-SharingAllowedDomainList'%2C%20'-SharingBlockedDomainList'%2C%20'-SharingCapability'%2C%20'-SharingDomainRestrictionMode'%2C%20'-ShowPeoplePickerSuggestionsForGuestUsers'%2C%20'-StorageQuota'%2C%20and%20'-StorageWarningLevel'.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20set-sposite%20%3CA%20href%3D%22https%3A%2F%2Frelyfinancepr-my.sharepoint.com%2Fpersonal%2Fjonnunez%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fcontoso-my.sharepoint.com%2Fpersonal%2Fuser%3C%2FA%3E%26nbsp%3B...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BSet-SPOSite%5D%2C%20ServerException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.SharePoint.Client.ServerException%2CMicrosoft.Online.SharePoint.PowerShell.SetSite%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I'm%20trying%20to%20do%20is%20have%20a%20small%20pilot%20where%20only%205%20users%26nbsp%3B%20can%20shar%20externally%20while%20the%20rest%20of%20the%20population%20has%20it%20disabled.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EThe%20script%20that%20i'm%20using%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%23Get%20Credentials%20to%20connect%0A%0A%24user%20%3D%20%22global%20admin%20email%22%3B%0A%0A%24pass%20%3D%20%22password%22%3B%0A%0A%24pwd%20%3D%20ConvertTo-SecureString%20%24pass%20-AsPlainText%20-Force%3B%0A%0A%24credentials%20%3D%20New-Object%20-TypeName%20System.Management.Automation.PSCredential%20-argumentlist%20%24user%2C%24pwd%3B%0A%0AConnect-SPOService%20-url%20https%3A%2F%2Fcontoso-admin.sharepoint.com%2F%20-Credential%20%24credentials%3B%0A%0A%20%0A%0ASet-SPOSite%20-Identity%20https%3A%2F%2Fsontoso-my.sharepoint.com%2Fpersonal%2Fuser_contoso_com%20%20-SharingCapability%20%20ExternalUserAndGuestSharing%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1407328%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E.Net%20Core%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAdvanced%20Threat%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAPI%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional 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