Forum Discussion
kath patterson
Nov 08, 2017Iron Contributor
Modern Site Classification - enabling and setting - story so far
there have been a lot of questions which touch on this and I have spent some time testing and exploring this setting with a view to using it in extensions later.
The story so far
Enabling - currently a powershell op - see https://www.youtube.com/watch?v=E-8Z2ggHcS0
- will be supported in PnP Core v.soon - see SIG 2nd Nov video https://www.youtube.com/watch?v=HNYBaMMTC-Y
- retrieving available value list will also be included in PnP Core
Setting
For Comms Sites - available on PnPsite object in powershell or Microsoft.SharePoint.Client.Site object in CSOM. works fine
Connect-PnPOnline -Url $siteUrl -Credentials $cred
$site = Get-PnPSite
Get-PnPProperty -ClientObject $site -Property Classification
$site.Classification
$site.Classification = "Test"
Execute-PnPQuery
Site spsite = ctx.Site;
ctx.Load(spsite, s => s.Classification);
ctx.ExecuteQueryRetry();
spsite.Classification = "Test";
ctx.ExecuteQueryRetry();
For Modern Team Sites - value is stored on both site and backing group. Group value overrides changes to site value so normal edit gets overwritten. Graph request is needed to set group at same time as site change is made.
PnP Core is being extended to encapsulate this process for all site types and make setting transparent with a new method off the Site object.
see SIG 2nd Nov video - https://www.youtube.com/watch?v=HNYBaMMTC-Y
If anyone else can add or update to this summary that would be great as I may have missed something.
No RepliesBe the first to reply