sharing with external users via powershell
-
07-02-2021 - |
Domanda
The tenancy is set to Allow users to invite and share with authenticated external users and it works for site collections created from the admin center.
I am trying to set a communication site to the exact value and I am using this powershell script.
Set-SPOSite -Identity https://XXXXXXX -SharingCapability ExternalUserAndGuestSharing
I get an error message saying that
The SharingCapability set for this SPOSite will not take effect until the 'ExternalUserAndGuestSharing' SharingCapability is also enabled on the SPOTenant.
I thought ExternalUserAndGuestSharing was the same as "Allow users to invite and share with authenticated external users
" but it does not seem the case.
What am I doing wrong?
I would like to avoid to set the tenancy to "Allow sharing to authenticated external users and using anonymous access links
"
Soluzione
You have to use below command for external sharing with authenticated external user with valid email address.
Set-SPOSite -Identity https://XXXXXXX -SharingCapability ExternalUserSharingOnly
Assuming you have below set at Tenant level
“Allow external users who accept sharing invitations and sign in as authenticated users”
Regarding ExternalUserAndGuestSharing - External user sharing (share by email) and guest link sharing are both enabled, this is for anonymous access.
Refer this link for more details