More Related Content Similar to Getting started with Office365/SharePoint Patterns and Practices (20) Getting started with Office365/SharePoint Patterns and Practices2. • Introduction to O365 and SharePoint PnP
• What is PnP?
• Why PnP?
• PnP Resources
• Getting started with PnP Managed Code
• Demo – Managed Code
• Getting started with PnP PowerShell CmdLets
• Demo - PowerShell
• Summary
• Q & A
3. Supported Environments
Office 365
SharePoint Online
SharePoint Server 2013/2016
What?
The Office 365 Developer and SharePoint Patterns and
Practices (PnP) initiative provides;
Code Samples
Documentation
How-to Videos
Guides
Why?
Ease of development
Simple
Availability of re-usable
components
6. PnP at dev.office.com - Welcome page with sample and guidance search
SharePoint Dev Group - Questions and feedback
PnP at MSDN
PnP videos at YouTube
PnP at Docs.com - Docs.com
PnP Sites Core Component - GitHub repository
PnP Core Component (JavaScript) - GitHub repository
PnP PowerShell - GitHub repository
PnP Partner Pack - Reusable starter kit for typical enterprise requirements
PnP Guidance - GitHub repository
PnP Office-Addins - GitHub repository
PnP Tools - GitHub repository
PnP Transformation - GitHub repository
PnP Provisioning Schema - GitHub repository
8. • Add NuGet Package
• SharePoint PnP Online
• SharePoint PnP 2013
• SharePoint PnP 2016
11. • Download PnP PowerShell installer
https://github.com/officedev/pnp-powershell/releases
https://github.com/SharePoint/PnP-PowerShell
12. Add-Type -Path 'C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.dll'
Add-Type -Path 'C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Runtime.dll'
$url = "https://liyanage.sharepoint.com/sites/developer"
$creds = Get-Credential -Message "Enter Online Credential"
$O365Credential = new-object Microsoft.SharePoint.Client.SharePointOnlineCredentials($creds.UserName,$creds.Password)
$ctx = new-object Microsoft.SharePoint.Client.ClientContext($url)
$ctx.Credentials = $O365Credential
$listCi = new-object Microsoft.SharePoint.Client.ListCreationInformation;
$listCi.Title = "Demo List";
$listCi.TemplateType = [Microsoft.SharePoint.Client.ListTemplateType]::GenericList;
$listCi.Url = "lists/demo";
$list = $ctx.Web.lists.Add($listCi);
# Add the field
$fieldXml = "<Field Type=""Choice"" Name=""SPSLocation"" DisplayName=""Location"" ID=""{ba27f512-27bc-4d07-bdd4-2ee61bc5bcb4}"" Group=""Demo
Group"" Required=""TRUE""><CHOICES><CHOICE>Stockholm</CHOICE><CHOICE>Helsinki</CHOICE><CHOICE>Oslo</CHOICE></CHOICES></Field>"
$field = $list.Fields.AddFieldAsXml($fieldXml, $true, [Microsoft.SharePoint.Client.AddFieldOptions]::AddFieldToDefaultView);
$ctx.Load($list);
$ctx.ExecuteQuery();
13. Connect-SPOnline -Url https://liyanage.sharepoint.com/sites/developer -Credentials
(Get-Credential)
New-SPOList -Title "PnP Demo list" -Template GenericList -Url lists/pnpdemo
Add-SPOField -List “PnP Demo list" `
-DisplayName "Location" `
-InternalName "SPSLocation" `
-Type Choice `
-Group "Demo Group" `
-AddToDefaultView `
-Choices "USA","Canada",”Australia"