280 likes | 293 Views
Learn how to manage sites, users, and groups in SharePoint Online with PowerShell. Automate business scenarios, schedule tasks using Azure, and enhance security through automated and remote scripting.
E N D
PowerShell + SharePoint Online – An Admins Guide to Administration in the O365 Cloud Marrell Sanders – Sr. SharePoint Administrator SharePoint Saturday Atlanta, GA | May 11, 2019
Who Am I Marrell Sanders, MCTS • Senior AppDev Administrator / Dev Ops Contact • Email: techrevmarrell@outlook.com • Blog: www.techrevmarrell.com • Twitter: @TechRevMarrell
Key Takeaways • What’s new with PoSh for SPO • How to manage sites, users, groups with O365 PowerShell • Automate Business Scenarios with PowerShell • Scheduling Tasks using Azure • Security with Automated and Remote Scripting
SharePoint Admin RoleWhat happened to it? Remember the good old days of SharePoint Administration? MOSS 2007 SharePoint 2010 or 2013? Huge Server Farms
Todd Klindtand Shane Young accuratelypredicted the collapse of the “old ways” of the SharePoint Administrators. “The Old Admin Ways Must End”
a long time ago, they asked the question. “Who can run a SharePoint farm better than us?”-M WinduDir of Product Teams
The team answered in unity“Nobody, were the originals. Lets form up.”
Learn a new skill Time to become a Developer….. Sort of, but not really, but kinda.
What is PowerShell? • PowerShell is an object-oriented programming language and interactive command line shell for Microsoft Windows. • #POSH • #PowerShell
Oh Wait… I can’t logon to an o365 tenant server
Use the Force Oh Wait… I can’t logon to an o365 tenant server
Use the Force Oh Wait… I can’t logon to an o365 tenant server
What tools do we have? SPO Service Connect-PNP And a bunch of others
PnP PowerShell SharePoint Patterns and Practices (PnP) contains a library of PowerShell commands (PnP PowerShell) that allows you to perform complex provisioning and artifact management actions towards SharePoint. The commands use CSOM and can work against both SharePoint Online as SharePoint On-Premises. https://docs.microsoft.com/en-us/powershell/
PnP VS SPO? • PnP PowerShell Cmdlets contains additional parameters to each command, which is used to achieve more tasks when compared to equivalent SPO command. • PnP PowerShell Cmdlets managed by Patterns and Practices team and it gets updated every month. Where as SPO cmdlets are windows PowerShell module to manage the SharePoint Online and this also get frequent updates. • PnP PowerShell Cmdlets works in the context of the current user, where as SPO command runs with the Tenant Admin rights. • PnP PowerShell Cmdlets connects to the Site Collection level, where as SPO has the commands to target Tenant level.
Context Switching Connect-PnPOnline -Url $siteAurl -Credentials $credentials $ctx = Get-PnPContext Get-PnPList# returns the lists from site specified with $siteAurlConnect-PnPOnline-Url $siteBurl -Credentials $credentialsGet-PnPList# returns the lists from the site specified with $siteBurl Set-PnPContext-Context $ctx# switch back to site A Get-PnPList# returns the lists from site A
I don’t want to have to type my username and password every time I run a script.
Windows Credential Manager Great Blog Post on PetriBy Shane Young https://bit.ly/2VTPgbz
Windows Credential Manager Great Blog Post on PetriBy Shane Young https://bit.ly/2VTPgbz
PowerShell Cheat Sheet https://bit.ly/2VY4bkU
Office 365 Site Designer Tool https://bit.ly/2LRWEAa
Shameless Plug for Vlad https://amzn.to/2JsSmN4
Resource Links https://github.com/SharePoint/PnP-PowerShell/wiki/How-to-use-the-Windows-Credential-Manager-to-ease-authentication-with-PnP-PowerShellhttps://laurakokkarinen.com/my-most-used-powershell-scripts-for-managing-sharepoint-online/ https://absolute-sharepoint.com/2018/03/create-a-report-of-sharepoint-online-external-users-with-powershell.html https://www.amazon.com/Essential-PowerShell-Office-365-Productivity/dp/1484231287