SlideShare a Scribd company logo
PowerShell: Through the SharePoint Looking Glass
Brian Caauwe – Manager, Business Productivity
April 22nd, 2017
Session Agenda
• What you NEED to know
• Scripting for on-prem
• Scripting for online
Who am I?
• Brian Caauwe
• Manager, Consultant, Speaker and new dad
• Email: bcaauwe@avtex.com
• Twitter: @bcaauwe
• Technical Editor
• Professional SharePoint 2013 Administration
• Certifications
• MCM: SharePoint Server 2010
• MCSM: SharePoint
Thank you Sponsors!
SharePoint Environment
Poll
• SharePoint 2007
• SharePoint 2010
• SharePoint 2013
• SharePoint 2016
• SharePoint Online
PowerShell: Through the SharePoint Looking Glass
Investigation
Automation
Learning
Get-Help
• ALWAYS run “As Administrator”
• Uses powershell.exe under Windowssystem32
• Microsoft.SharePoint.Powershell snap-in
– C:Program FilesCommon FilesMicrosoft SharedWeb Server
Extensions15[6]CONFIGPOWERSHELLRegistrationsharepoint.ps1
• Sets ExecutionPolicy to RemoteSigned
• 700+ Cmdlets – SharePoint 2013
• 800+ Cmdlets – SharePoint 2016
Management Shell
On-Premise
• Microsoft.SharePoint namespace
• Server Architecture
• SPFarm
• SPWebApplication
• SPContentDatabase
• Site Architecture
• SPSite
• SPWeb
• SPList
• SPListItem
• MSDN Resource
• https://msdn.microsoft.com/en-us/library/jj193058.aspx
Server Side
Object Model
• Uses powershell.exe same as on-prem
• Imports the module
• Microsoft.Online.SharePoint.PowerShell
• Sets ExecutionPolicy to RemoteSigned
• Only 42 Cmdlets
• Also includes 84 Cmdlets for Azure AD Module
• Supplement
• Client Side Object Model (CSOM)
Management Shell
Online
• Microsoft.SharePoint.Client namespace
• Starting Point
• Microsoft.SharePoint.Client.ClientContext
• Microsoft.SharePoint.Client.SharePointOnlineCredentials
• Microsoft.SharePoint.Client.Web
• Microsoft.SharePoint.Client.Site
• MSDN Resource
• https://msdn.microsoft.com/en-
us/library/microsoft.sharepoint.client.aspx
Client Side
Object Model
• Call PowerShell from Windowssystem32
• Register Microsoft.SharePoint.Powershell snap-in
-psconsolefile “C:Program FilesCommon FilesMicrosoft
SharedWeb Server Extensions15[6]CONFIGPOWERSHELL
Registrationpsconsole.psc1”
• Call Script
-command “E:PowerShellSet-ScriptName.ps1”
• Logging
Scheduled Tasks
Memory Leaks
• Disposable Objects
$web.Dispose()
$site.Dispose()
• SPAssignment – Garbage Collector
Global
Start-SPAssignment -Global
Get-SPSite –Limit All | Get-SPWeb | Select Url, WebTemplate, WebTemplateId
Stop-SPAssignment -Global
Scoped
$w = Get-SPWebApplication http://www.company.com
$siteScope = Start-SPAssignment
foreach ($site in ($siteScope | Get-SPSite -Limit All –WebApplication $))
{
$webScope = Start-SPAssignment
foreach ($web in ($webScope | Get-SPWeb -Limit All -Site $site))
{
## Do Something
}
Stop-SPAssignment $webScope
}
Stop-SPAssignment $siteScope
• Other Assemblies
• IIS (WebAdministration)
• SQL
• Exchange
• User Profile
• Microsoft.Office.Server.UserProfiles
• Managed Metadata
• Microsoft.SharePoint.Taxonomy
On-prem
• High Level Cmdlets
• Get-SPWebApplication
• Get-SPSite
• Get-SPWeb
Day-to-Day
$w = Get-SPWebApplication http://my.company.com
$site = Get-SPSite http://my.company.com
$site | Get-SPWeb -Limit All
• Will utilize Log Cmdlets
• New-SPLogFile
• Merge-SPLogFile
Troubleshooting
New-SPLogFile
Merge-SPLogFile –Path “C:Debugerror.log” –Correlation
470a4ec2-985d-43be-a14e-176eb1c39672
• Will utilize SPSolution Cmdlets
• Add-SPSolution
• Get-SPSolution
• Install-SPSolution
Customizations
Add-SPSolution –LiteralPath “C:Solutionsspcmis.wsp”
$sol = Get-SPSolution | ?{$_.Name –eq “spcmis.wsp”}
$sol | Install-SPSolution –GACDeployment –AllWebApplications –Compatibilitylevel All
• End users request a site into a list
• Automate site creation
• Inform user of progress
• Enforce Governance
Site Request
Site Request
Lay of the land…
• List Location: http://portal.lab.com
• List Title: Site Requests
• Columns:
• Title* (Single line of text)
• Abbreviation* (Single line of text)
• Site Description (Multiple lines of text)
• Site Type* (Choice)
• Size* (Choice)
• Site Owner* (Person)
• Secondary Owner* (Person)
• Site Contributors (Person-Multi)
• Site Visitors (Person-Multi)
• Status (Choice) [Hidden]
• Default Value [Submitted]
• Status Description (Multiple lines of text) [Hidden]
* Required Fields
Demo
Site Request Process
Online
• Utilize Cmdlet
• Connect-SPOService
Connecting
Connect-SPOService –url https://tenant-admin.sharepoint.com
• Limited Cmdlets
• Get/Set-SPOSite
• Get/Set/Remove-SPOUser
Day-to-Day
$site = Get-SPSite https://[tenant].sharepoint.com
Set-SPOUser -LoginName user@email.com -Site $site -IsSiteCollectionAdmin $true
Core
Objects
CSOM PnP
• Everything starts with the Client Context
Client Side
Object Model
$username = “user@email.com”
$password = ConvertTo-SecureString -String “pass@word1” -AsPlainText
-Force
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$ctx.Credentials = New-Object
Microsoft.SharePoint.Client.SharePointOnlineCredentials($username,
$password)
• Using Load and ExecuteQuery to use objects
Client Side
Object Model
$web = $ctx.Web
$site = $ctx.Site
$ctx.Load($web)
$ctx.Load($site)
$ctx.ExecuteQuery()
$creds = New-Object System.Management.Automation.PSCredential
“user@email.com”, (ConvertTo-SecureString “pass@word1” -AsPlainText -force)
Connect-PnPOnline –Url $url –Credentials $creds
$ctx = Get-PnPContext
$ctx.RequestTimeout = [System.Threading.Timeout]::Infinite
$root = Get-PnPWeb
PnP PowerShell
Starts with the Connect-PnPOnline
Revolves around PnPContext
$provisioningList = Get-PnPList -Identity $listName
$query = "<View><Query><Where><Eq><FieldRef Name='Status'></FieldRef><Value
Type='Text'>Submitted</Value></Eq></Where></Query></View>"
$items = Get-PnPListItem -List $provisioningList -Query $query
Set-PnPListItem -List "Provisioning List" -Identity $item.Id -Values @{"Status"="In
Progress";"StatusDescription"="Starting site creation process"}
New-PnPGroup -Title $ownerGroupName -Owner $siteOwner.Email
Get-PnPGroup -AssociatedOwnerGroup -Web $web
Set-PnPGroup -Identity $ownersGroup -SetAssociatedGroup Owners
Set-PnPGroupPermissions -Identity $ownersGroup -AddRole "Full Control“
Add-PnPUserToGroup -LoginName $siteOwner.Email -Identity $ownersGroup
PnP PowerShell
Wraps CSOM methods and objects
New-PnPTenantSite -Title $item.Title -Url $siteLocation -Owner $siteOwner.Email -
TimeZone 11 -Description $siteDescription -Template $siteTemplate –Wait
New-PnPWeb -Title $item.Title -Url $webLocation -Template $siteTemplate -Web
$parentWeb -Locale 1033 -BreakInheritance
Demo
PnP PowerShell
Questions
Feedback Url :
http://whova.com/event/program/168097/?email=bcaauwe@avtex.com&simpl
e_agenda=True&platform=webapp
Give Me Feedback
Whova
How to get ahold of me?
• Brian Caauwe
• Email: bcaauwe@avtex.com
• Twitter: @bcaauwe
http://webinars.avtex.com/
Resources
• Windows PowerShell for SharePoint 2013
• https://technet.microsoft.com/en-us/library/ee662539.aspx
• Office Dev Patterns and Practices GitHub
• https://github.com/SharePoint/PnP
• PnP PowerShell
• https://github.com/sharepoint/pnp-powershell/
• SharePoint Server 2013 Client Components SDK
• http://www.microsoft.com/en-us/download/details.aspx?id=35585
• SharePoint Online Management Shell
• http://www.microsoft.com/en-us/download/details.aspx?id=35588
• Display a list of OneDrive for Business Site Collections
• https://technet.microsoft.com/en-us/library/dn911464.aspx
• Using Lambda Expressions with CSOM in PowerShell
• http://www.itunity.com/article/loading-specific-values-lambda-expressions-sharepoint-csom-api-
windows-powershell-1249
PowerShell: Through the SharePoint Looking Glass

More Related Content

PPTX
SPSSTL - PowerShell - Through the SharePoint Looking Glass
PPTX
SPSTC - PowerShell - Through the SharePoint Looking Glass
PPTX
Real World Lessons in Progressive Web Application & Service Worker Caching
PDF
Service workers
PPTX
Disrupting the application eco system with progressive web applications
PDF
AtlasCamp 2015: Using add-ons to build add-ons
PDF
PWA 與 Service Worker
PDF
Instant and offline apps with Service Worker
SPSSTL - PowerShell - Through the SharePoint Looking Glass
SPSTC - PowerShell - Through the SharePoint Looking Glass
Real World Lessons in Progressive Web Application & Service Worker Caching
Service workers
Disrupting the application eco system with progressive web applications
AtlasCamp 2015: Using add-ons to build add-ons
PWA 與 Service Worker
Instant and offline apps with Service Worker

What's hot (19)

PDF
Asset Redux - Front end performance on Rails (Phil Nash)
PPTX
Service workers your applications never felt so good
PPTX
PowerShell Basics for Office Apps and Servers
PPTX
JavaScript front end performance optimizations
PPT
Service Workers for Performance
KEY
HTML5 Hacking - Yahoo! Open Hack Day
PPTX
Service workers and the role they play in modern day web apps
PDF
Firebase slide
PDF
Web Development with NodeJS
PPTX
Develop a vanilla.js spa you and your customers will love
PDF
[Bristol WordPress] Supercharging WordPress Development
PDF
Scalable web application architecture
PDF
Laravel 8 export data as excel file with example
PDF
Serverless Ballerina
PDF
BDD in Java using Cucumber
PPTX
An Introduction to hapi.js
PPTX
Apex & jQuery Mobile
PDF
Service worker API
PDF
Velocity EU 2014 — Offline-first web apps
Asset Redux - Front end performance on Rails (Phil Nash)
Service workers your applications never felt so good
PowerShell Basics for Office Apps and Servers
JavaScript front end performance optimizations
Service Workers for Performance
HTML5 Hacking - Yahoo! Open Hack Day
Service workers and the role they play in modern day web apps
Firebase slide
Web Development with NodeJS
Develop a vanilla.js spa you and your customers will love
[Bristol WordPress] Supercharging WordPress Development
Scalable web application architecture
Laravel 8 export data as excel file with example
Serverless Ballerina
BDD in Java using Cucumber
An Introduction to hapi.js
Apex & jQuery Mobile
Service worker API
Velocity EU 2014 — Offline-first web apps
Ad

Similar to PowerShell: Through the SharePoint Looking Glass (20)

PPTX
SPO Migration - New API
PPTX
Power Shell and Sharepoint 2013
PDF
Operacion Guinda 2
PPTX
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
PDF
ASP.NET Overview - Alvin Lau
PDF
Powershell to the People #suguk
PPTX
The Power of Document Generation with Nintex
PPTX
Share point hosted add ins munich
PPTX
Office 365 & PowerShell - A match made in heaven
PDF
Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
PDF
Deploying SharePoint @ Cloud
PPTX
The Path through SharePoint Migrations
PPTX
An Introduction to the Office 365 Patterns and Practices Project
PPTX
How to do everything with PowerShell
PPTX
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
PDF
Supercharging WordPress Development - Wordcamp Brighton 2019
PPTX
WinOps Conf 2016 - Michael Greene - Release Pipelines
PPTX
Webinar - Office 365 & PowerShell : A Match Made in Heaven
PPTX
[Vončina] Configuring SharePoint 2016 for BI Scenarios
PDF
SharePoint Fest Chicago 2015 - Anatomy of configuring provider hosted add-in...
SPO Migration - New API
Power Shell and Sharepoint 2013
Operacion Guinda 2
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
ASP.NET Overview - Alvin Lau
Powershell to the People #suguk
The Power of Document Generation with Nintex
Share point hosted add ins munich
Office 365 & PowerShell - A match made in heaven
Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
Deploying SharePoint @ Cloud
The Path through SharePoint Migrations
An Introduction to the Office 365 Patterns and Practices Project
How to do everything with PowerShell
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
Supercharging WordPress Development - Wordcamp Brighton 2019
WinOps Conf 2016 - Michael Greene - Release Pipelines
Webinar - Office 365 & PowerShell : A Match Made in Heaven
[Vončina] Configuring SharePoint 2016 for BI Scenarios
SharePoint Fest Chicago 2015 - Anatomy of configuring provider hosted add-in...
Ad

More from Brian Caauwe (8)

PPTX
SPSLA - What to Expect with SharePoint 2019
PPTX
WISPUG - Fun with SharePoint Migrations
PPTX
SPSSTL - Understanding the Collaboration Toolkit
PPTX
SPSSTL - Content Management Internals
PPTX
SPSSTL - Building Search Driven Applications
PPTX
The Path Through SharePoint Migrations
PPTX
Building Search Driven Applications
PPTX
Demystifying Workflow
SPSLA - What to Expect with SharePoint 2019
WISPUG - Fun with SharePoint Migrations
SPSSTL - Understanding the Collaboration Toolkit
SPSSTL - Content Management Internals
SPSSTL - Building Search Driven Applications
The Path Through SharePoint Migrations
Building Search Driven Applications
Demystifying Workflow

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
cloud_computing_Infrastucture_as_cloud_p
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
August Patch Tuesday
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Heart disease approach using modified random forest and particle swarm optimi...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Tartificialntelligence_presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation theory and applications.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Mobile App Security Testing_ A Comprehensive Guide.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
cloud_computing_Infrastucture_as_cloud_p
SOPHOS-XG Firewall Administrator PPT.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
OMC Textile Division Presentation 2021.pptx
August Patch Tuesday
Building Integrated photovoltaic BIPV_UPV.pdf
Spectroscopy.pptx food analysis technology
Heart disease approach using modified random forest and particle swarm optimi...

PowerShell: Through the SharePoint Looking Glass

  • 1. PowerShell: Through the SharePoint Looking Glass Brian Caauwe – Manager, Business Productivity April 22nd, 2017
  • 2. Session Agenda • What you NEED to know • Scripting for on-prem • Scripting for online
  • 3. Who am I? • Brian Caauwe • Manager, Consultant, Speaker and new dad • Email: [email protected] • Twitter: @bcaauwe • Technical Editor • Professional SharePoint 2013 Administration • Certifications • MCM: SharePoint Server 2010 • MCSM: SharePoint
  • 5. SharePoint Environment Poll • SharePoint 2007 • SharePoint 2010 • SharePoint 2013 • SharePoint 2016 • SharePoint Online
  • 11. • ALWAYS run “As Administrator” • Uses powershell.exe under Windowssystem32 • Microsoft.SharePoint.Powershell snap-in – C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15[6]CONFIGPOWERSHELLRegistrationsharepoint.ps1 • Sets ExecutionPolicy to RemoteSigned • 700+ Cmdlets – SharePoint 2013 • 800+ Cmdlets – SharePoint 2016 Management Shell On-Premise
  • 12. • Microsoft.SharePoint namespace • Server Architecture • SPFarm • SPWebApplication • SPContentDatabase • Site Architecture • SPSite • SPWeb • SPList • SPListItem • MSDN Resource • https://msdn.microsoft.com/en-us/library/jj193058.aspx Server Side Object Model
  • 13. • Uses powershell.exe same as on-prem • Imports the module • Microsoft.Online.SharePoint.PowerShell • Sets ExecutionPolicy to RemoteSigned • Only 42 Cmdlets • Also includes 84 Cmdlets for Azure AD Module • Supplement • Client Side Object Model (CSOM) Management Shell Online
  • 14. • Microsoft.SharePoint.Client namespace • Starting Point • Microsoft.SharePoint.Client.ClientContext • Microsoft.SharePoint.Client.SharePointOnlineCredentials • Microsoft.SharePoint.Client.Web • Microsoft.SharePoint.Client.Site • MSDN Resource • https://msdn.microsoft.com/en- us/library/microsoft.sharepoint.client.aspx Client Side Object Model
  • 15. • Call PowerShell from Windowssystem32 • Register Microsoft.SharePoint.Powershell snap-in -psconsolefile “C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15[6]CONFIGPOWERSHELL Registrationpsconsole.psc1” • Call Script -command “E:PowerShellSet-ScriptName.ps1” • Logging Scheduled Tasks
  • 16. Memory Leaks • Disposable Objects $web.Dispose() $site.Dispose() • SPAssignment – Garbage Collector Global Start-SPAssignment -Global Get-SPSite –Limit All | Get-SPWeb | Select Url, WebTemplate, WebTemplateId Stop-SPAssignment -Global Scoped $w = Get-SPWebApplication http://www.company.com $siteScope = Start-SPAssignment foreach ($site in ($siteScope | Get-SPSite -Limit All –WebApplication $)) { $webScope = Start-SPAssignment foreach ($web in ($webScope | Get-SPWeb -Limit All -Site $site)) { ## Do Something } Stop-SPAssignment $webScope } Stop-SPAssignment $siteScope
  • 17. • Other Assemblies • IIS (WebAdministration) • SQL • Exchange • User Profile • Microsoft.Office.Server.UserProfiles • Managed Metadata • Microsoft.SharePoint.Taxonomy
  • 19. • High Level Cmdlets • Get-SPWebApplication • Get-SPSite • Get-SPWeb Day-to-Day $w = Get-SPWebApplication http://my.company.com $site = Get-SPSite http://my.company.com $site | Get-SPWeb -Limit All
  • 20. • Will utilize Log Cmdlets • New-SPLogFile • Merge-SPLogFile Troubleshooting New-SPLogFile Merge-SPLogFile –Path “C:Debugerror.log” –Correlation 470a4ec2-985d-43be-a14e-176eb1c39672
  • 21. • Will utilize SPSolution Cmdlets • Add-SPSolution • Get-SPSolution • Install-SPSolution Customizations Add-SPSolution –LiteralPath “C:Solutionsspcmis.wsp” $sol = Get-SPSolution | ?{$_.Name –eq “spcmis.wsp”} $sol | Install-SPSolution –GACDeployment –AllWebApplications –Compatibilitylevel All
  • 22. • End users request a site into a list • Automate site creation • Inform user of progress • Enforce Governance Site Request
  • 23. Site Request Lay of the land… • List Location: http://portal.lab.com • List Title: Site Requests • Columns: • Title* (Single line of text) • Abbreviation* (Single line of text) • Site Description (Multiple lines of text) • Site Type* (Choice) • Size* (Choice) • Site Owner* (Person) • Secondary Owner* (Person) • Site Contributors (Person-Multi) • Site Visitors (Person-Multi) • Status (Choice) [Hidden] • Default Value [Submitted] • Status Description (Multiple lines of text) [Hidden] * Required Fields
  • 26. • Utilize Cmdlet • Connect-SPOService Connecting Connect-SPOService –url https://tenant-admin.sharepoint.com
  • 27. • Limited Cmdlets • Get/Set-SPOSite • Get/Set/Remove-SPOUser Day-to-Day $site = Get-SPSite https://[tenant].sharepoint.com Set-SPOUser -LoginName [email protected] -Site $site -IsSiteCollectionAdmin $true
  • 29. • Everything starts with the Client Context Client Side Object Model $username = “[email protected]” $password = ConvertTo-SecureString -String “pass@word1” -AsPlainText -Force $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
  • 30. • Using Load and ExecuteQuery to use objects Client Side Object Model $web = $ctx.Web $site = $ctx.Site $ctx.Load($web) $ctx.Load($site) $ctx.ExecuteQuery()
  • 31. $creds = New-Object System.Management.Automation.PSCredential “[email protected]”, (ConvertTo-SecureString “pass@word1” -AsPlainText -force) Connect-PnPOnline –Url $url –Credentials $creds $ctx = Get-PnPContext $ctx.RequestTimeout = [System.Threading.Timeout]::Infinite $root = Get-PnPWeb PnP PowerShell Starts with the Connect-PnPOnline Revolves around PnPContext
  • 32. $provisioningList = Get-PnPList -Identity $listName $query = "<View><Query><Where><Eq><FieldRef Name='Status'></FieldRef><Value Type='Text'>Submitted</Value></Eq></Where></Query></View>" $items = Get-PnPListItem -List $provisioningList -Query $query Set-PnPListItem -List "Provisioning List" -Identity $item.Id -Values @{"Status"="In Progress";"StatusDescription"="Starting site creation process"} New-PnPGroup -Title $ownerGroupName -Owner $siteOwner.Email Get-PnPGroup -AssociatedOwnerGroup -Web $web Set-PnPGroup -Identity $ownersGroup -SetAssociatedGroup Owners Set-PnPGroupPermissions -Identity $ownersGroup -AddRole "Full Control“ Add-PnPUserToGroup -LoginName $siteOwner.Email -Identity $ownersGroup PnP PowerShell Wraps CSOM methods and objects New-PnPTenantSite -Title $item.Title -Url $siteLocation -Owner $siteOwner.Email - TimeZone 11 -Description $siteDescription -Template $siteTemplate –Wait New-PnPWeb -Title $item.Title -Url $webLocation -Template $siteTemplate -Web $parentWeb -Locale 1033 -BreakInheritance
  • 36. How to get ahold of me? • Brian Caauwe • Email: [email protected] • Twitter: @bcaauwe
  • 38. Resources • Windows PowerShell for SharePoint 2013 • https://technet.microsoft.com/en-us/library/ee662539.aspx • Office Dev Patterns and Practices GitHub • https://github.com/SharePoint/PnP • PnP PowerShell • https://github.com/sharepoint/pnp-powershell/ • SharePoint Server 2013 Client Components SDK • http://www.microsoft.com/en-us/download/details.aspx?id=35585 • SharePoint Online Management Shell • http://www.microsoft.com/en-us/download/details.aspx?id=35588 • Display a list of OneDrive for Business Site Collections • https://technet.microsoft.com/en-us/library/dn911464.aspx • Using Lambda Expressions with CSOM in PowerShell • http://www.itunity.com/article/loading-specific-values-lambda-expressions-sharepoint-csom-api- windows-powershell-1249

Editor's Notes

  • #10: You won’t learn by books or sessions Find YOUR practical applications
  • #11: Use Get-Help for information on Cmdlets Full property for verbose information Examples for… Examples