Raised from #1648
We should extend the spo site set command with a new option called --sharingCapability that is optional, which accepts a valid SharingCapabilities value.
The valid values are as follows.
Source: https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/dn174825(v=office.15)
Can I take ownership of this issue?
All yours @arjunumenon 馃憦
Hi @garrytrinder / @waldekmastykarz - I have made the implementation of the new feature which is to add SharingCapabilities to o365 spo site set
Before I finalize the approach, I just want to confirm the implementation.
Since SharingCapabilities setting could be enabled only thorough a REST call to the tenant URL. Following are the details
URL : https://TENANTNAME-admin.sharepoint.com/_vti_bin/client.svc/ProcessQuery
Request Body :
<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="Office 365 CLI v2.13.0" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
<Actions>
<ObjectPath Id="2" ObjectPathId="1"/>
<ObjectPath Id="4" ObjectPathId="3"/>
<SetProperty Id="5" ObjectPathId="3" Name="SharingCapability">
<Parameter Type="Enum">2</Parameter>
</SetProperty>
<ObjectPath Id="7" ObjectPathId="6"/>
<ObjectIdentityQuery Id="8" ObjectPathId="3"/>
</Actions>
<ObjectPaths>
<Constructor Id="1" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}"/>
<Method Id="3" ParentId="1" Name="GetSitePropertiesByUrl">
<Parameters>
<Parameter Type="String">https://TENANTNAME.sharepoint.com/sites/SITENAME</Parameter>
<Parameter Type="Boolean">false</Parameter>
</Parameters>
</Method>
<Method Id="6" ParentId="3" Name="Update"/>
</ObjectPaths>
</Request>
Can you verify and let me know the implementation is correct so that I could freeze the approach from my side. Let me know if you have any questions / my approach is not correct.
Hey @arjunumenon I'm not completely up on this API but it looks ok to me. I assume you've taken the approach of using Fiddler to snoop on the CSOM request to understand the required XML payload?
Thanks @garrytrinder for the direction. I did.
I had snooped the fiddler trace for CSOM and have confirmed the payload which is being sent. I also had verified the fiddler trace for PnP PowerShell as well.
I would be finalizing the approach and would be making a PR pretty soon.
Thanks again for the support.
Great, thanks for your help @arjunumenon 馃憤馃徎
Most helpful comment
Thanks @garrytrinder for the direction. I did.
I had snooped the fiddler trace for CSOM and have confirmed the payload which is being sent. I also had verified the fiddler trace for PnP PowerShell as well.
I would be finalizing the approach and would be making a PR pretty soon.
Thanks again for the support.