sharepoint online administration with...
TRANSCRIPT
![Page 1: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/1.jpg)
SharePoint Online Administration with
Powershell Illya Williams
![Page 2: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/2.jpg)
Agenda
� SharePoint Online Management Shell
� On-Premises vs. Online Cmdlets
� Using the Client Side Object Model (CSOM)
� Real World Examples!
![Page 3: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/3.jpg)
The Challenge
� SharePoint administrators rely heavily on PowerShell
� Office 365 is a $1.5 billion a year business and growing
� What does the increased adoption of Office 365 mean for traditional SharePoint administrators?
![Page 4: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/4.jpg)
The Challenge
� Does No Server Access == No PowerShell?
� Are we back in the dark ages of GUI based administration?
![Page 5: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/5.jpg)
The Solution
� Of course not – A number of PowerShell Cmdlets are available for SharePoint Online!
� Download the SharePoint Online Management Shell to get started here
![Page 6: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/6.jpg)
SharePoint Online Management Shell
� Includes 41 Cmdlets, which is slightly less than On-Premises!
![Page 7: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/7.jpg)
O365 vs. On Premises Cmdlets
� Set-SPOSite
� Get-SPOSite
� New-SPOSite
� Remove-SPOSite
� New-SPOUser
� ….
� Spot the difference?
![Page 8: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/8.jpg)
SharePoint Online vs. On Premises Cmdlets
� “I will only need to make minor changes to my scripts” � Wrong!!! – Cmdlets aren’t functionally equivalent � Have different Methods and Properties � In some cases behave differently
![Page 9: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/9.jpg)
SharePoint Online vs. On Premises Cmdlets
� Example: � Get-SPSite returns all Site Collections � Get-SPOSite returns all Site Collections except My Sites
� In some cases limitations can be addressed using a different approach – more on this later…
![Page 10: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/10.jpg)
SPOL Management Shell – Getting Started
� Import the Microsoft.Online.SharePoint.PowerShell Module
� Use Connect-SPOService to connect to the Tenant
![Page 11: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/11.jpg)
Get-SPOSite Summary
� Use the –Detailed parameter with Get-SPOSite if you need the following properties returned: � LockIssue � WebsCount
� CompatibilityLevel � AllowSelfServiceUpgrade
� ResourceUsageCurrent
� ResourceUsageAverage � StorageUsageCurrent
� Further documentation here
![Page 12: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/12.jpg)
Example: What Sites Do I Have?
� Inventory all Site Collections and output results to a CSV file using Get-SPOSite
![Page 13: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/13.jpg)
Example: Auditing External Access
� Who has access? Where do they have access? Who invited them?
![Page 14: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/14.jpg)
Example: Configuring External Access
� Configure the External Sharing Capability for a specific Site Collection
� Use Set-SPOSite with the SharingCapability parameter, options: � Disabled � ExternalUserAndGuestSharing
� ExternalUserSharingOnly
![Page 15: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/15.jpg)
Example: Auditing External Access
� Who has access? Where do they have access? Who invited them?
![Page 16: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/16.jpg)
Site Level Administration
� Set-SPOSite can be used to: � Change Site Owner
� Configure the Storage and Resource Quota
� Change the Title
![Page 17: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/17.jpg)
Site Level Administration
� Set-SPOSite can also be used to: � Lock a Site
� Requests for locked Sites can be redirected to a specific
URL
� Redirect URL is configurable using Set-SPOTenant -NoAccessRedirectURL
![Page 18: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/18.jpg)
Tenant Level Settings
� Get/Set-SPOTenant can be used to retrieve and update Tenant level settings
� Sometimes the only option!
![Page 19: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/19.jpg)
How Does this All Work?
� Get-SPOSite “Under the Covers” � Connects to the client.svc WCF service and sends a request
as XML � Response is returned as JSON
![Page 20: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/20.jpg)
But, What about x?
� SharePoint Online Management Shell is great for basic Site Collection and User administration
� But… � I can do x On-Premises, it doesn’t appear to be possible to
do this using the SharePoint Online Management Shell? � I need to do something with Managed Metadata, User
Profiles and Search, why isn’t there a Cmdlet?
![Page 21: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/21.jpg)
CSOM to the Rescue!
� The Client Side Object Model was introduced in SharePoint 2010 and is available in SharePoint Online
� Provides a subset of the Server Object Model - can be executed remotely using JavaScript or .NET (PowerShell in this case)
![Page 22: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/22.jpg)
Getting Started with CSOM
� Download the SharePoint Online Client Components SDK here
� Includes the DLLs required for CSOM
� Fire up PowerShell and away we go…
![Page 23: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/23.jpg)
CSOM – A little different
� CSOM is different to the Server Side Object Model
� To minimize data transfer a slightly different approach is used
� Requests are bundled together and then sent to the server for execution
� Only when an object has been returned, can it be used
![Page 24: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/24.jpg)
CSOM: 4 Steps to Success!
1. Create Variable
2. Load into the Context
3. Execute the Query
4. Use the Variable
![Page 25: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/25.jpg)
But what about Service Applications???
� CSOM can also be used with Managed Metadata, Search and User Profiles
� The relevant assemblies need to be referenced � Microsoft.SharePoint.Client.Taxonomy.dll (Managed Metadata)
� Microsoft.SharePoint.Client.Search.dll (Search)
� Microsoft.SharePoint.Client.UserProfiles.dll (User Profiles)
![Page 26: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/26.jpg)
Example: Exporting all User Profiles
![Page 27: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/27.jpg)
Example: Exporting all User Profiles
![Page 28: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/28.jpg)
Example: Adding Terms to the Term Store
![Page 29: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/29.jpg)
Example: Adding Terms to the Term Store
![Page 30: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/30.jpg)
Example: Adding Terms to the Term Store
![Page 31: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/31.jpg)
Next Steps…
� Need to do something else?
� Refer to the Microsoft.SharePoint.Client namespace documentation on MSDN
� The possibilities are endless (kind of!)
![Page 32: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/32.jpg)
Next Steps…
� Office 365 Patterns and Practices (PnP) includes a HUGE number of additional PowerShell Cmdlets, examples include: � Add/Remove a Content Type
� Set a Master Page
� Disable/Enable a Feature
� Add a Web Part
� …the list goes on!
![Page 33: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/33.jpg)
Next Steps…
� SharePoint 2013 Client Browser is a great tool to determine the data that can be obtained using CSOM.
![Page 34: SharePoint Online Administration with Powershellfiles.meetup.com/19493949/IAW-SharePointOnline-Powershell-Part1.pdf · do this using the SharePoint Online Management Shell? ! I need](https://reader030.vdocuments.us/reader030/viewer/2022040705/5e036c8144a7a522d9457cb2/html5/thumbnails/34.jpg)
Questions ?