Forum Discussion
davidrosmon
Mar 13, 2019Copper Contributor
Issue Setting Domains AllowList for Sharing in CSOM API
Hi all We found an issue trying to set allowed domains for sharing through CSOM. When setting the site property's SharingDomainRestrictionMode to AllowList and setting the SharingAllowedDomainLis...
- May 09, 2019
If you want to switch between block and allow mode, you need to set the mode to None, then execute and the set it to whatever your looking to do.
var siteProperties = tenant.GetSitePropertiesByUrl(siteCollectionUrl, false);
ctx.Load(siteProperties, s => s.SharingDomainRestrictionMode, s => s.SharingAllowedDomainList);
ctx.ExecuteQueryRetry();
siteProperties.SharingDomainRestrictionMode = SharingDomainRestrictionModes.None;
siteProperties.Update();
ctx.ExecuteQueryRetry();siteProperties.SharingDomainRestrictionMode = SharingDomainRestrictionModes.AllowList;
siteProperties.SharingAllowedDomainList = domainString;
siteProperties.Update();
ctx.ExecuteQueryRetry();
davidrosmon
Apr 26, 2019Copper Contributor
Borup-DK
Apr 29, 2019Copper Contributor