This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FieldUserValue authorUser = (FieldUserValue) listItem["Author"]; | |
User author = web.EnsureUser(authorUser.LookupValue); | |
bool byPassAuthorCreation = false; | |
try | |
{ | |
context.Load(author); | |
context.ExecuteQuery(); | |
}catch(Exception ex) | |
{byPassAuthorCreation=true;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void InitializeService(DataServiceConfiguration config) | |
{ | |
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc. | |
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead); | |
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3; | |
config.UseVerboseErrors = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ListTemplateCollection templates = context.Site.GetCustomListTemplates(context.Web); | |
context.Load(templates); | |
context.ExecuteQuery(); | |
log.Info("Templates Loaded"); | |
// Initialize list or library creation info | |
var template = templates.First(listTemp => listTemp.Name == "<name of template>"); | |
var listCreationInfo = new ListCreationInformation(); | |
listCreationInfo.Title = LibName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log.Info("Inheriting permissions"); | |
//Inherit permissions if broken | |
rListitem.ResetRoleInheritance(); | |
transList.ResetRoleInheritance(); | |
log.Info("Now let's start breaking the permissions again"); | |
// Break permissions | |
rListitem.BreakRoleInheritance(false, false); | |
transList.BreakRoleInheritance(false, false); | |
RoleAssignmentCollection collRoleAssign = destList.RoleAssignments; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void InitializeService(DataServiceConfiguration config) | |
{ | |
// TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc. | |
// Examples: | |
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead); | |
// config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All); | |
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3; | |
config.UseVerboseErrors = true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context.Web.AllProperties[“PropertyBagValue1”] = “Property” | |
context.Web.Update() | |
context.Web.ExecuteQuery() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Online.SharePoint.TenantAdministration; | |
using (var contextTenant = new ClientContext(<spTenantUrl>)) | |
{ | |
contextTenant.Credentials = new SharePointOnlineCredentials(<username>, <secpass>); | |
Tenant tSP = new Tenant(contextTenant); | |
tSP.SetSiteProperties(<groupurl>, noScriptSite: false); | |
contextTenant.ExecuteQuery(); | |
} | |
contextGroup.Web.SetPropertyBagValue("ProvisioningStatus", "Completed"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "schema.json", | |
"actions": [ | |
{ | |
"verb": "applyTheme", | |
"themeName": "Custom Dark Blue custom" | |
}, | |
{ | |
"verb": "createSPList", | |
"listName": "Training Registration", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "object", | |
"properties": { | |
"webUrl": { | |
"type": "string" | |
}, | |
"parameters": { | |
"type": "object", | |
"properties": { | |
"event": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Output "Incoming request for '$in'" | |
Connect-PnPOnline -AppId $env:AppId -AppSecret $env:AppSecret -Url $in | |
Write-Output "Connected to site" | |
Apply-PnPProvisioningTemplate -Path D:\home\site\wwwroot\<function name>\<template>.xml |
OlderNewer