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 (var ctx = new ClientContext(<site url>)) | |
{ | |
ctx.RequestTimeout = Timeout.Infinite; | |
Web web = ctx.Web; | |
ctx.Load(web, w => w.Title); | |
ctx.ExecuteQueryRetry(); | |
ProvisioningTemplateApplyingInformation ptai | |
= new ProvisioningTemplateApplyingInformation | |
{ |
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 (Context ctx = new ClientContext(<siteUrl>)) | |
{ | |
string TemplateFilename = "<FileName>.xml"; | |
ctx.Load(ctx.Web, w => w.Lists, w => w.Folders); | |
Microsoft.SharePoint.Client.File templateFile = ctx.Web.Lists.GetByTitle("Site Assets").RootFolder.Folders.GetByUrl("Templates").GetFile(TemplateFilename); | |
ctx.ExecuteQuery(); | |
FileInformation fileInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(ctx, templateFile.ServerRelativeUrl); | |
assetContext.ExecuteQuery(); | |
filePath = Path.GetTempPath() + "\\" + TemplateFilename; | |
using (var fileStream = new FileStream(filePath, FileMode.Create)) |
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 Microsoft.SharePoint.Client; | |
using OfficeDevPnP.Core.Sites; | |
using (ClientContext ctx = new ClientContext(<TenantAdminUrl>)) | |
{ | |
// create new "modern" team site at the url | |
// https://[tenant].sharepoint.com/sites/mymodernteamsite | |
string alias = taskParam.TargetWebUrl.Substring(Url.LastIndexOf('/') + 1); | |
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 OfficeDevPnP.Core.Framework.Graph; | |
using Microsoft.Graph; | |
using Microsoft.SharePoint.Client; | |
using Microsoft.IdentityModel.Clients.ActiveDirectory; | |
var authenticationContext = new AuthenticationContext(authString, false); | |
// Config for OAuth client credentials | |
ClientCredential clientCred = new ClientCredential(clientId, clientSecret); | |
AuthenticationResult authenticationResult = null; | |
string token = ""; |
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.SharePoint.Client; | |
using Microsoft.SharePoint.Client.DocumentManagement; | |
// Replace all instances of < > with your variables | |
using (var context = new ClientContext(<siteUrl>)) | |
{ | |
context.Credentials = new SharePointOnlineCredentials(UserName, SecurePass); | |
listToOperate = context.Web.GetListByUrl(<listRelUrl>); | |
context.Load(listToOperate); | |
context.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
return processComplete | |
? req.CreateResponse(HttpStatusCode.OK, "Success") | |
: req.CreateResponse(HttpStatusCode.Accepted, "Error"); |
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
UnifiedGroupsUtility.UpdateUnifiedGroup(group.GroupId, token, groupLogo: <logo url>, | |
members:<Members email array>, isPrivate: <boolean>, retryCount: <numberofretries>); |