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.

SPSToronto 2015 - Managing Office365 with PowerShell and CSOM

487 views

Published on

How to automate Office365 (SharePoint Online) tasks using PowerShell and CSOM

Published in: Technology
  • Be the first to comment

  • Be the first to like this

SPSToronto 2015 - Managing Office365 with PowerShell and CSOM

  1. 1. Managing (O365) with PowerShell + CSOM
  2. 2. GOLDRAFFLESILVER PLATINUM
  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. GOLDRAFFLESILVER PLATINUM
  29. 29. Thank you! Toronto Enterprise Collaboration User Group Change Management, Governance, SharePoint, Office 365, Yammer, PowerBI, etc http://www.meetup.com/TSPBUG/ Toronto SharePoint Business Users Group http://www.meetup.com/TorontoSPUG/ Saturday July 9, 2016 See you next year!
  30. 30. EVALS http://spbuzz.it/spsto2015-evals
  31. 31. THANK YOU

×