Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Managing (O365) with PowerShell + CSOM
EVENT Sponsors
• Diamond, Platinum & Gold sponsors
have tables
• Please visit them and inquire about
their products & serv...
HELLO!My name is
Amit VasuSr. SharePoint Consultant, MVP
www.amitvasu.com
Twitter: @amitvasu
Session Objective
 Understand how to automate different SharePoint
Online (Office 365) tasks using PowerShell and CSOM
 ...
History Lesson
Amit’s PowerShell + CSOM Journey
“FTC to CAM – Stop creating content types and site
columns declaratively”
http://blogs.msdn.com/b/vesku/archive/2013/11/06...
Typical CT deployment process
How do we overcome - On Premises
What are the challenges with O365
 Guidance to not use declarative code for CT
 You cannot use custom code in Sandbox so...
Remote Provisioning to Rescue
Remote Provisioning
 Write C# CSOM/REST Provider hosted App
 JSOM
 PowerShell + CSOM
SharePoint Farm
1
Provider Hosted
Apps
Own app specific
configuration
Artefacts
2
4
CSOM / REST
3
Remote Provisioning Proc...
CSOM – Power Talk
Remote Provisioning
 Client side library for remotely communicating with SharePoint
 Introduced in SharePoint 2010
 Exp...
CSOM in SharePoint 2010
CSOM in SharePoint 2013
How CSOM Works
CSOM – Code Example
 Create Context
ClientContext ctx = new ClientContext("http://intranet.contoso.com");
 Call Load and...
How do I start
Steps to start developing
 Pick your Development environment
 Local Machine
 SharePoint 2013 Environment
Local Machine
 Required copy of all SharePoint Client DLL
 Located at C:Program FilesCommon Filesmicrosoft sharedWeb Ser...
SharePoint Environment
 No need to do anything other than referencing DLLs
from ISAPI folder.
Optional – Download CSOM Assemblies
DEMO
PowerShell + CSOM
Summary
Why PowerShell + CSOM
 Anything you can do with CSOM can be achieved using PowerShell
+ CSOM
 Great way to extend PowerS...
Resources
 https://sharepointpowershell.codeplex.com/
 https://sharepointonlineautomationcmdlets.codeplex.com/
 http://...
Connecticut SharePoint users group
• Different SharePoint discussions
each month on various topics.
• Meets 3rd Thursday o...
Special October session!
• Michelle Caldwell (MVP) will be
making a stop at the CTSPUG
• Microsoft Store in West Farms
Mal...
EVENT Sponsors
• Diamond, Platinum & Gold sponsors
have tables
• Please visit them and inquire about
their products & serv...
EVALS
THANK YOU
Upcoming SlideShare
Loading in …5
×

Spsct15 power shell_csom - amit vasu

271 views

Published on

SPSCT 2015 - PowerShell + CSOM

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Spsct15 power shell_csom - amit vasu

  1. 1. Managing (O365) with PowerShell + CSOM
  2. 2. EVENT Sponsors • Diamond, Platinum & Gold sponsors have tables • Please visit them and inquire about their products & services • Also they have lots of awesome schwag that you can’t live without! 
  3. 3. HELLO!My name is Amit VasuSr. SharePoint Consultant, MVP www.amitvasu.com Twitter: @amitvasu
  4. 4. Session Objective  Understand how to automate different SharePoint Online (Office 365) tasks using PowerShell and CSOM  This session is for Developers  And IT Pro as well ……May be NOT 
  5. 5. History Lesson Amit’s PowerShell + CSOM Journey
  6. 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
  7. 7. Typical CT deployment process
  8. 8. How do we overcome - On Premises
  9. 9. What are the challenges with O365  Guidance to not use declarative code for CT  You cannot use custom code in Sandbox solution.  Farm solutions are out of question.
  10. 10. Remote Provisioning to Rescue
  11. 11. Remote Provisioning  Write C# CSOM/REST Provider hosted App  JSOM  PowerShell + CSOM
  12. 12. SharePoint Farm 1 Provider Hosted Apps Own app specific configuration Artefacts 2 4 CSOM / REST 3 Remote Provisioning Process – CSOM/REST
  13. 13. CSOM – Power Talk
  14. 14. Remote Provisioning  Client side library for remotely communicating with SharePoint  Introduced in SharePoint 2010  Expanded upon in SharePoint 2013
  15. 15. CSOM in SharePoint 2010
  16. 16. CSOM in SharePoint 2013
  17. 17. How CSOM Works
  18. 18. CSOM – Code Example  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);
  19. 19. How do I start
  20. 20. Steps to start developing  Pick your Development environment  Local Machine  SharePoint 2013 Environment
  21. 21. 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
  22. 22. SharePoint Environment  No need to do anything other than referencing DLLs from ISAPI folder.
  23. 23. Optional – Download CSOM Assemblies
  24. 24. DEMO PowerShell + CSOM
  25. 25. Summary
  26. 26. Why PowerShell + CSOM  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-premises  Spend time understanding CSOM  Microsoft.SharePoint.Client namespace
  27. 27. Resources  https://sharepointpowershell.codeplex.com/  https://sharepointonlineautomationcmdlets.codeplex.com/  http://social.technet.microsoft.com/wiki/contents/articles/29518.c som-sharepoint-powershell-reference-and-example-codes.aspx
  28. 28. Connecticut SharePoint users group • Different SharePoint discussions each month on various topics. • Meets 3rd Thursday of every month • Microsoft Office (Hartford) • 280 Trumbull St, Hartford CT 06103 • http://www.meetup.com/ctspug
  29. 29. Special October session! • Michelle Caldwell (MVP) will be making a stop at the CTSPUG • Microsoft Store in West Farms Mall • Wednesday – October 14th • Register today! – http://www.meetup.com/ctspug
  30. 30. EVENT Sponsors • Diamond, Platinum & Gold sponsors have tables • Please visit them and inquire about their products & services • Also they have lots of awesome schwag that you can’t live without! 
  31. 31. EVALS
  32. 32. THANK YOU

×