Skip to content

Instantly share code, notes, and snippets.

View gautamdsheth's full-sized avatar
:shipit:
Shipping

Gautam Sheth gautamdsheth

:shipit:
Shipping
View GitHub Profile
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2019/09/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.19.2003.0, Culture=neutral, PublicKeyToken=5e633289e95c321a">
<pnp:Parameters>
<pnp:Parameter Key="O365TenantName">Contoso</pnp:Parameter>
</pnp:Parameters>
</pnp:Preferences>
<pnp:Tenant>
<pnp:SPUsersProfiles>
<pnp:SPUserProfile TargetUser="user1@{parameter:O365TenantName}.onmicrosoft.com">
<pnp:Property Key="Department" Value="IT" />
@gautamdsheth
gautamdsheth / PnPControlsTest.ts
Created April 6, 2020 14:11
PnP Controls in property pane
import * as React from 'react';
import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library';
import {
IPropertyPaneConfiguration,
PropertyPaneTextField
} from '@microsoft/sp-property-pane';
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
import * as strings from 'TestPnPControlsV110WebPartStrings';
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema https://raw.githubusercontent.com/OfficeDev/PnP-Provisioning-Schema/master/OfficeDevPnP.ProvisioningSchema/ProvisioningSchema-2019-03.xsd">
<pnp:Preferences Author="Blade Runner" Version="1.0" />
<pnp:Teams>
<pnp:TeamTemplate DisplayName="Team from Template 01" Description="Sample Team from Template"
Classification="Custom" Visibility="Public">
<![CDATA[
{
"template@odata.bind": "https://graph.microsoft.com/beta/teamsTemplates('standard')",
"visibility": "Private",
"displayName": "Sample Engineering Team",
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using ClientSidePage = OfficeDevPnP.Core.Pages.ClientSidePage;
namespace ConsoleApp1
Connect-PnPOnline -Url "https://<your-site-url>"
# Get the template from the template folder
$page = Get-PnPClientSidePage -Identity "Templates/IT_Template"
# Save the page with a new name based on the template
$page.Save("IT-India.aspx")
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using ClientSidePage = OfficeDevPnP.Core.Pages.ClientSidePage;
namespace ConsoleApp1
Connect-PnPOnline -Url "https://<your-site-url>"
# Assumes that you already have a page named IT.aspx
# created and ready to be used as a template
$page = Get-PnPClientSidePage -Identity "IT.aspx"
# Save the page as template to be reused later-on
$page.SaveAsTemplate("IT_Template.aspx")
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using Newtonsoft.Json.Linq;
using OfficeDevPnP.Core;
using OfficeDevPnP.Core.Framework.Provisioning.Connectors;
using OfficeDevPnP.Core.Framework.Provisioning.Model;
using OfficeDevPnP.Core.Framework.Provisioning.ObjectHandlers;
using OfficeDevPnP.Core.Framework.Provisioning.Providers;
using OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml;
using System;
Connect-PnPOnline -Url "<your-tenant>" -Scopes "Group.ReadWrite.All","User.Read.All"
Apply-PnPTenantTemplate -Path "Teams.xml"
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema https://raw.githubusercontent.com/OfficeDev/PnP-Provisioning-Schema/master/OfficeDevPnP.ProvisioningSchema/ProvisioningSchema-2019-03.xsd">
<pnp:Preferences Author="Blade Runner" Version="1.0" />
<pnp:Teams>
<pnp:Team MailNickname="HRTeam" DisplayName="HR Team" Description="This is just a team for HR" Classification=""
Visibility="Public" Archived="false">
<pnp:FunSettings AllowGiphy="true" GiphyContentRating="Moderate"
AllowStickersAndMemes="true" AllowCustomMemes="true"/>
<pnp:GuestSettings AllowCreateUpdateChannels="true" AllowDeleteChannels="false"/>
<pnp:MembersSettings AllowCreateUpdateChannels="true" AllowDeleteChannels="false"
AllowAddRemoveApps="true"