Spsnyc 2014   o365 power shell csom
THANK YOU
EVENT SPONSORS
• Please visit them and inquire about
their products & services
• To win prizes make sure to get your
bingo card stamped by ALL sponsors
http://www.sharepointnutsandbolts.com/
Chis O’Brien - MVP
Reference:
http://www.sharepointnutsandbolts.com/2013/12/Usin
g-CSOM-in-PowerShell-scripts-with-Office365.html
Credit for this session
Self Promotion 
Microsoft
Community
Contributor (MCC)
Senior
SharePoint
Consultant
@amitvasuMCP – SP 2013
BLOG – www.amitvasu.com/blog
SharePoint Saturday Toronto
Agenda
PowerShell + CSOM
Background and CSOM Overview
How to Start DEMO
Final Thoughts
Why PowerShell + CSOM
Q/A
SharePoint Saturday Toronto
Agenda
“FTC to CAM – Stop creating content types and site columns
declaratively”
http://blogs.msdn.com/b/vesku/archive/2013/11/06/ftc-to-cam-stop-creating-content-types-
and-site-columns-declaratively.aspx
How I started PowerShell + CSOM
SharePoint Saturday Toronto
Typical CT deployment process
SharePoint Saturday Toronto
What is being recommended
SharePoint Saturday Toronto
Challenge with O365
 Guidance to not use declarative code for CT
 You cannot use custom code in Sandbox
solution.
 Farm solutions are out of question.
SharePoint Saturday Toronto
Spsnyc 2014   o365 power shell csom
CSOM Overview
 Client side library for remotely communicating with
SharePoint
 Introduced in SharePoint 2010
 Expanded upon in SharePoint 2013
SharePoint Saturday Toronto
CSOM Overview
How CSOM Works
SharePoint Saturday Toronto
How CSOM Works –SP 2013
 SharePoint 2013
SharePoint Saturday Toronto
How CSOM Works
 Create Context
ClientContext ctx = new
ClientContext("http://intranet.contoso.com");
 Call Load and ExecuteQuery Before Accessing
Value Properties
Web web = ctx.Web;
ctx.Load(web);
ctx.ExecuteQuery();
Console.WriteLine(web.Title);
SharePoint Saturday Toronto
Spsnyc 2014   o365 power shell csom
Steps to start developing
 Pick your Development environment
 Local Machine
 SharePoint 2013 Environment
SharePoint Saturday Toronto
Local Machine
 Required copy of all SharePoint Client DLL
 Located at C:Program FilesCommon Filesmicrosoft
sharedWeb Server Extensions15ISAPI
 All DLLs that starts with Microsoft.SharePoint.Client
 Reference them in your code from the location
you copied them
SharePoint Saturday Toronto
SharePoint Environment
 No need to do anything other than referencing
DLLs from ISAPI folder.
SharePoint Saturday Toronto
Optional – Download SPO DLLs
 Rene Modery - Script to download the
SharePoint Online DLLs
http://modery.net/script-to-download-the-sharepoint-online-
dlls/?utm_source=rss&utm_medium=rss&utm_campaign=script-to-download-
the-sharepoint-online-dlls
SharePoint Saturday Toronto
Spsnyc 2014   o365 power shell csom
Add reference to your DLLs
$filePath = "c:Program FilesCommon Filesmicrosoft
sharedWeb Server Extensions15ISAPI"
Set-Location $filePath
Add-Type -Path (Resolve-Path
"Microsoft.SharePoint.Client.dll")
Add-Type -Path (Resolve-Path
"Microsoft.SharePoint.Client.Runtime.dll")
SharePoint Saturday Toronto
Authentication - SPO
$userName = "SomeUser@SomeOrg.onmicrosoft.com"
$siteUrl = "https://SomeSite.sharepoint.com"
$pwd = Read-Host -AsSecureString
$ctx = New-Object
Microsoft.SharePoint.Client.ClientContext($siteUrl)
$ctx.Credentials = New-Object
Microsoft.SharePoint.Client.SharePointOnlineCredenti
als($userName, $pwd)
SharePoint Saturday Toronto
Authentication – On-Prem
$userName = "SomeUser@SomeOrg.onmicrosoft.com"
$siteUrl = "https://SomeSite.sharepoint.com"
$pwd = Read-Host -AsSecureString
$ctx = New-Object
Microsoft.SharePoint.Client.ClientContext($siteUrl)
$ctx.Credentials = New-Object
System.Net.NetworkCredential($userName, $pwd)
SharePoint Saturday Toronto
Spsnyc 2014   o365 power shell csom
Spsnyc 2014   o365 power shell csom
Advantages
 Repeatable and automated
 Same script can be used across different
environments
 Extending out of the box PowerShell
 Works with on-prem as well as SharePoint Online *
SharePoint Saturday Toronto
Spsnyc 2014   o365 power shell csom
Summary
 Anything you can do with CSOM can be achieved
using PowerShell + CSOM
 Great way to extend PowerShell capabilities
 Can be used with SharePoint Online and On-prem
 Spend time understanding CSOM
 Microsoft.SharePoint.Client namespace
SharePoint Saturday Toronto
Spsnyc 2014   o365 power shell csom
THANK YOU
EVENT SPONSORS
• Please visit them and inquire about
their products & services
• To win prizes make sure to get your
bingo card stamped by ALL sponsors
Spsnyc 2014   o365 power shell csom

More Related Content

PDF
Spsnyc15 azure and sp2013 amit_v
PDF
Spsdc 2014 o365_power_shell_csom_amitv
PPTX
Single page applications & SharePoint
PPTX
Share Point 2010 Workflow
PPTX
SharePoint Framework at a glance
PDF
2014-04-05 - SPSPhilly - Getting Started with Office 365
PDF
2014-04-05 - SPSPhilly - Authentication and Authorization
PPTX
Configuring Workflows in SharePoint 2010
Spsnyc15 azure and sp2013 amit_v
Spsdc 2014 o365_power_shell_csom_amitv
Single page applications & SharePoint
Share Point 2010 Workflow
SharePoint Framework at a glance
2014-04-05 - SPSPhilly - Getting Started with Office 365
2014-04-05 - SPSPhilly - Authentication and Authorization
Configuring Workflows in SharePoint 2010

Viewers also liked (20)

PPTX
Evaluation 4
PPTX
Evaluation 2
DOC
Ke hoach tao website moi 1
PPTX
Las UVA, Urbanismo Cívico Pedagógico, Arquitectura que transforma sociedades
PPTX
TrialPay Security Tech Talk at Stanford ACM
PDF
Stb en 12594
PDF
Stb 1674 2006
PDF
Seven simple steps for a wonderful outlook on life
PPTX
Prepositions of places
PDF
WP_Cost-theHiddenKiller_Final
PPS
Building life
DOCX
POEMA Ciudadana
PDF
African american-consumer-untold-story-sept-2015
PPTX
Young scients at iiif 2016
PDF
Banques et Assurances : Comment lutter avec une plus grande efficacite contre...
PDF
Ap aimp
PPSX
INDUS VALLEY CIVILISATION - ARISE ROBY
PDF
Spsto 2013 whats_newinworkflows_amitvasu.
PPSX
Lenda padeira de aljubarrota.pps - Diogo Silva, 11.ºB
DOCX
Different kinds of Probability
Evaluation 4
Evaluation 2
Ke hoach tao website moi 1
Las UVA, Urbanismo Cívico Pedagógico, Arquitectura que transforma sociedades
TrialPay Security Tech Talk at Stanford ACM
Stb en 12594
Stb 1674 2006
Seven simple steps for a wonderful outlook on life
Prepositions of places
WP_Cost-theHiddenKiller_Final
Building life
POEMA Ciudadana
African american-consumer-untold-story-sept-2015
Young scients at iiif 2016
Banques et Assurances : Comment lutter avec une plus grande efficacite contre...
Ap aimp
INDUS VALLEY CIVILISATION - ARISE ROBY
Spsto 2013 whats_newinworkflows_amitvasu.
Lenda padeira de aljubarrota.pps - Diogo Silva, 11.ºB
Different kinds of Probability
Ad

Similar to Spsnyc 2014 o365 power shell csom (20)

PDF
Spsct15 power shell_csom - amit vasu
PDF
SPSToronto 2015 - Managing Office365 with PowerShell and CSOM
PPTX
Introducción al SharePoint Framework SPFx
PPTX
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
PPTX
Intro to SharePoint for Developers
PDF
Sps boston 2014_o365_power_shell_csom_amitv
PPTX
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
PPTX
SharePoint & jQuery Guide - SPSTC 5/18/2013
PDF
Spsdc what's new in share point 2013 workflow
PPTX
The SharePoint & jQuery Guide - Updated 1/14/14
PDF
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
PDF
Full trust code is not dead
PPTX
KMA Deck -C. McNulty discusses ecm wcm-upgrades2010 - nyc
PDF
build -test and deploy software aplplications with visual studio alm 2012-2013
PPTX
Managesp 160805190411
PPT
SharePoint Governance: From Chaos to Success in 10 Steps
PPTX
Achieve quick wins in your organization with Power Automate
PPTX
#SPSBurgh 2018 How to do #devops with the #SharePoint Framework #spfx
PPTX
(Updated) SharePoint & jQuery Guide
PPTX
Designing SharePoint 2010 for Business
Spsct15 power shell_csom - amit vasu
SPSToronto 2015 - Managing Office365 with PowerShell and CSOM
Introducción al SharePoint Framework SPFx
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
Intro to SharePoint for Developers
Sps boston 2014_o365_power_shell_csom_amitv
Chris O'Brien - Modern SharePoint development: techniques for moving code off...
SharePoint & jQuery Guide - SPSTC 5/18/2013
Spsdc what's new in share point 2013 workflow
The SharePoint & jQuery Guide - Updated 1/14/14
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
Full trust code is not dead
KMA Deck -C. McNulty discusses ecm wcm-upgrades2010 - nyc
build -test and deploy software aplplications with visual studio alm 2012-2013
Managesp 160805190411
SharePoint Governance: From Chaos to Success in 10 Steps
Achieve quick wins in your organization with Power Automate
#SPSBurgh 2018 How to do #devops with the #SharePoint Framework #spfx
(Updated) SharePoint & jQuery Guide
Designing SharePoint 2010 for Business
Ad

More from amitvasu (10)

PDF
Introducing-Loop.pdf
PDF
Updating your classic team site to use new office 365 features amit vasu
PDF
Introduction to azure functions
PDF
Office 365 Directory Synchronization
PDF
Office 365 directory synchronization - SPSDC Reston
PPTX
Tspug 2015 dirsync_amit_v_momentum
PDF
Sps albany 2014_workflows_amit_vasu
PDF
Spsdc using sp2013 to crawl sp2010 farm
PDF
Sps ottawa 2013_workflows_amit_vasu
PPTX
Using workflows in share point 2010
Introducing-Loop.pdf
Updating your classic team site to use new office 365 features amit vasu
Introduction to azure functions
Office 365 Directory Synchronization
Office 365 directory synchronization - SPSDC Reston
Tspug 2015 dirsync_amit_v_momentum
Sps albany 2014_workflows_amit_vasu
Spsdc using sp2013 to crawl sp2010 farm
Sps ottawa 2013_workflows_amit_vasu
Using workflows in share point 2010

Recently uploaded (20)

PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PPTX
Modernising the Digital Integration Hub
PDF
sbt 2.0: go big (Scala Days 2025 edition)
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PPTX
TEXTILE technology diploma scope and career opportunities
DOCX
search engine optimization ppt fir known well about this
PPT
What is a Computer? Input Devices /output devices
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
Build Your First AI Agent with UiPath.pptx
PDF
CloudStack 4.21: First Look Webinar slides
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PPTX
Chapter 5: Probability Theory and Statistics
PDF
Zenith AI: Advanced Artificial Intelligence
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Consumable AI The What, Why & How for Small Teams.pdf
Modernising the Digital Integration Hub
sbt 2.0: go big (Scala Days 2025 edition)
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Getting started with AI Agents and Multi-Agent Systems
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
TEXTILE technology diploma scope and career opportunities
search engine optimization ppt fir known well about this
What is a Computer? Input Devices /output devices
The influence of sentiment analysis in enhancing early warning system model f...
Developing a website for English-speaking practice to English as a foreign la...
Build Your First AI Agent with UiPath.pptx
CloudStack 4.21: First Look Webinar slides
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Improvisation in detection of pomegranate leaf disease using transfer learni...
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
A proposed approach for plagiarism detection in Myanmar Unicode text
Chapter 5: Probability Theory and Statistics
Zenith AI: Advanced Artificial Intelligence

Spsnyc 2014 o365 power shell csom

  • 2. THANK YOU EVENT SPONSORS • Please visit them and inquire about their products & services • To win prizes make sure to get your bingo card stamped by ALL sponsors
  • 3. http://www.sharepointnutsandbolts.com/ Chis O’Brien - MVP Reference: http://www.sharepointnutsandbolts.com/2013/12/Usin g-CSOM-in-PowerShell-scripts-with-Office365.html Credit for this session
  • 4. Self Promotion  Microsoft Community Contributor (MCC) Senior SharePoint Consultant @amitvasuMCP – SP 2013 BLOG – www.amitvasu.com/blog SharePoint Saturday Toronto
  • 5. Agenda PowerShell + CSOM Background and CSOM Overview How to Start DEMO Final Thoughts Why PowerShell + CSOM Q/A SharePoint Saturday Toronto Agenda
  • 6. “FTC to CAM – Stop creating content types and site columns declaratively” http://blogs.msdn.com/b/vesku/archive/2013/11/06/ftc-to-cam-stop-creating-content-types- and-site-columns-declaratively.aspx How I started PowerShell + CSOM SharePoint Saturday Toronto
  • 7. Typical CT deployment process SharePoint Saturday Toronto
  • 8. What is being recommended SharePoint Saturday Toronto
  • 9. Challenge with O365  Guidance to not use declarative code for CT  You cannot use custom code in Sandbox solution.  Farm solutions are out of question. SharePoint Saturday Toronto
  • 11. CSOM Overview  Client side library for remotely communicating with SharePoint  Introduced in SharePoint 2010  Expanded upon in SharePoint 2013 SharePoint Saturday Toronto CSOM Overview
  • 12. How CSOM Works SharePoint Saturday Toronto
  • 13. How CSOM Works –SP 2013  SharePoint 2013 SharePoint Saturday Toronto
  • 14. How CSOM Works  Create Context ClientContext ctx = new ClientContext("http://intranet.contoso.com");  Call Load and ExecuteQuery Before Accessing Value Properties Web web = ctx.Web; ctx.Load(web); ctx.ExecuteQuery(); Console.WriteLine(web.Title); SharePoint Saturday Toronto
  • 16. Steps to start developing  Pick your Development environment  Local Machine  SharePoint 2013 Environment SharePoint Saturday Toronto
  • 17. Local Machine  Required copy of all SharePoint Client DLL  Located at C:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions15ISAPI  All DLLs that starts with Microsoft.SharePoint.Client  Reference them in your code from the location you copied them SharePoint Saturday Toronto
  • 18. SharePoint Environment  No need to do anything other than referencing DLLs from ISAPI folder. SharePoint Saturday Toronto
  • 19. Optional – Download SPO DLLs  Rene Modery - Script to download the SharePoint Online DLLs http://modery.net/script-to-download-the-sharepoint-online- dlls/?utm_source=rss&utm_medium=rss&utm_campaign=script-to-download- the-sharepoint-online-dlls SharePoint Saturday Toronto
  • 21. Add reference to your DLLs $filePath = "c:Program FilesCommon Filesmicrosoft sharedWeb Server Extensions15ISAPI" Set-Location $filePath Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.dll") Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.Runtime.dll") SharePoint Saturday Toronto
  • 22. Authentication - SPO $userName = "SomeUser@SomeOrg.onmicrosoft.com" $siteUrl = "https://SomeSite.sharepoint.com" $pwd = Read-Host -AsSecureString $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredenti als($userName, $pwd) SharePoint Saturday Toronto
  • 23. Authentication – On-Prem $userName = "SomeUser@SomeOrg.onmicrosoft.com" $siteUrl = "https://SomeSite.sharepoint.com" $pwd = Read-Host -AsSecureString $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) $ctx.Credentials = New-Object System.Net.NetworkCredential($userName, $pwd) SharePoint Saturday Toronto
  • 26. Advantages  Repeatable and automated  Same script can be used across different environments  Extending out of the box PowerShell  Works with on-prem as well as SharePoint Online * SharePoint Saturday Toronto
  • 28. Summary  Anything you can do with CSOM can be achieved using PowerShell + CSOM  Great way to extend PowerShell capabilities  Can be used with SharePoint Online and On-prem  Spend time understanding CSOM  Microsoft.SharePoint.Client namespace SharePoint Saturday Toronto
  • 30. THANK YOU EVENT SPONSORS • Please visit them and inquire about their products & services • To win prizes make sure to get your bingo card stamped by ALL sponsors