SlideShare ist ein Scribd-Unternehmen logo
1 von 37
PowerShell: Through the SharePoint Looking Glass
Brian Caauwe – Manager, Business Productivity
January 20th, 2018
Agenda
Who am I?
• Brian Caauwe
• Manager, Consultant, Speaker and new dad of 2
• Email: bcaauwe@avtex.com
• Twitter: @bcaauwe
• Technical Editor
• Professional SharePoint 2013 Administration
• Certifications
• MCM: SharePoint Server 2010
• MCSM: SharePoint
Gold Sponsors
SHAREPOINT SATURDAY
ST.LOUIS 2018
Silver Sponsors
Bronze Sponsors
SharePoint Environment
Poll
• SharePoint 2007
• SharePoint 2010
• SharePoint 2013
• SharePoint 2016
• SharePoint Online
Investigation
Automation
Learning
Get-Help
• ALWAYS run “As Administrator”
• Uses powershell.exe under Windowssystem32
• Microsoft.SharePoint.Powershell snap-in
– C:Program FilesCommon FilesMicrosoft SharedWeb Server
Extensions15[6]CONFIGPOWERSHELLRegistrationsharepoint.ps1
• Sets ExecutionPolicy to RemoteSigned
• 700+ Cmdlets – SharePoint 2013
• 800+ Cmdlets – SharePoint 2016
Management Shell
On-Premise
• Microsoft.SharePoint namespace
• Server Architecture
• SPFarm
• SPWebApplication
• SPContentDatabase
• Site Architecture
• SPSite
• SPWeb
• SPList
• SPListItem
• MSDN Resource
• https://msdn.microsoft.com/en-us/library/jj193058.aspx
Server Side
Object Model
• Uses powershell.exe same as on-prem
• Imports the module
• Microsoft.Online.SharePoint.PowerShell
• Sets ExecutionPolicy to RemoteSigned
• Only 42 Cmdlets
• Also includes 84 Cmdlets for Azure AD Module
• Supplement
• Client Side Object Model (CSOM)
• Patterns and Practices (PnP)
Management Shell
Online
• Microsoft.SharePoint.Client namespace
• Starting Point
• Microsoft.SharePoint.Client.ClientContext
• Microsoft.SharePoint.Client.SharePointOnlineCredentials
• Microsoft.SharePoint.Client.Web
• Microsoft.SharePoint.Client.Site
• MSDN Resource
• https://msdn.microsoft.com/en-
us/library/microsoft.sharepoint.client.aspx
Client Side
Object Model
• Call PowerShell from Windowssystem32
• Register Microsoft.SharePoint.Powershell snap-in
-psconsolefile “C:Program FilesCommon FilesMicrosoft
SharedWeb Server Extensions15[6]CONFIGPOWERSHELL
Registrationpsconsole.psc1”
• Call Script
-command “E:PowerShellSet-ScriptName.ps1”
• Logging
Scheduled Tasks
Memory Leaks
• Disposable Objects
$web.Dispose()
$site.Dispose()
• SPAssignment – Garbage Collector
Global
Start-SPAssignment -Global
Get-SPSite –Limit All | Get-SPWeb | Select Url, WebTemplate, WebTemplateId
Stop-SPAssignment -Global
Scoped
$w = Get-SPWebApplication http://www.company.com
$siteScope = Start-SPAssignment
foreach ($site in ($siteScope | Get-SPSite -Limit All –WebApplication $))
{
$webScope = Start-SPAssignment
foreach ($web in ($webScope | Get-SPWeb -Limit All -Site $site))
{
## Do Something
}
Stop-SPAssignment $webScope
}
Stop-SPAssignment $siteScope
• Other Assemblies
• IIS (WebAdministration)
• SQL
• Exchange
• User Profile
• Microsoft.Office.Server.UserProfiles
• Managed Metadata
• Microsoft.SharePoint.Taxonomy
On-prem
• High Level Cmdlets
• Get-SPWebApplication
• Get-SPSite
• Get-SPWeb Day-to-Day
$w = Get-SPWebApplication http://my.company.com
$site = Get-SPSite http://my.company.com
$site | Get-SPWeb -Limit All
• Will utilize Log Cmdlets
• New-SPLogFile
• Merge-SPLogFile
Troubleshooting
New-SPLogFile
Merge-SPLogFile –Path “C:Debugerror.log” –Correlation
470a4ec2-985d-43be-a14e-176eb1c39672
• Will utilize SPSolution Cmdlets
• Add-SPSolution
• Get-SPSolution
• Install-SPSolution
Customizations
Add-SPSolution –LiteralPath “C:Solutionsspcmis.wsp”
$sol = Get-SPSolution | ?{$_.Name –eq “spcmis.wsp”}
$sol | Install-SPSolution –GACDeployment –AllWebApplications –Compatibilitylevel All
• End users request a site into a list
• Automate site creation
• Inform user of progress
• Enforce Governance
Site Request
Site Request
Lay of the land…
• List Location: http://portal.lab.com
• List Title: Site Requests
• Columns:
• Title* (Single line of text)
• Abbreviation* (Single line of text)
• Site Description (Multiple lines of text)
• Site Type* (Choice)
• Size* (Choice)
• Site Owner* (Person)
• Secondary Owner* (Person)
• Site Contributors (Person-Multi)
• Site Visitors (Person-Multi)
• Status (Choice) [Hidden]
• Default Value [Submitted]
• Status Description (Multiple lines of text) [Hidden]
* Required Fields
Demo
Site Request Process
Online
• Utilize Cmdlet
• Connect-SPOService
Connecting
Connect-SPOService –url https://tenant-admin.sharepoint.com
• Limited Cmdlets
• Get/Set-SPOSite
• Get/Set/Remove-SPOUser
Day-to-Day
$site = Get-SPSite https://[tenant].sharepoint.com
Set-SPOUser -LoginName user@email.com -Site $site -IsSiteCollectionAdmin $true
Core
Objects
CSOM
• Everything starts with the Client Context
Client Side
Object Model
$username = “user@email.com”
$password = ConvertTo-SecureString -String “pass@word1” -AsPlainText
-Force
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url)
$ctx.Credentials = New-Object
Microsoft.SharePoint.Client.SharePointOnlineCredentials($username,
$password)
• Using Load and ExecuteQuery to use objects
Client Side
Object Model
$web = $ctx.Web
$site = $ctx.Site
$ctx.Load($web)
$ctx.Load($site)
$ctx.ExecuteQuery()
$creds = New-Object System.Management.Automation.PSCredential
“user@email.com”, (ConvertTo-SecureString “pass@word1” -AsPlainText
-force)
Connect-PnPOnline –Url $url –Credentials $creds
$ctx = Get-PnPContext
$ctx.RequestTimeout = [System.Threading.Timeout]::Infinite
$root = Get-PnPWeb
Starts with the Connect-PnPOnline
Revolves around PnPContext
PnP
PowerShell
$provisioningList = Get-PnPList -Identity $listName
$query = "<View><Query><Where><Eq><FieldRef Name='Status'></FieldRef><Value
Type='Text'>Submitted</Value></Eq></Where></Query></View>"
$items = Get-PnPListItem -List $provisioningList -Query $query
Set-PnPListItem -List "Provisioning List" -Identity $item.Id -Values
@{"Status"="In Progress";"StatusDescription"="Starting site creation process"}
New-PnPGroup -Title $ownerGroupName -Owner $siteOwner.Email
Get-PnPGroup -AssociatedOwnerGroup -Web $web
Set-PnPGroup -Identity $ownersGroup -SetAssociatedGroup Owners
Set-PnPGroupPermissions -Identity $ownersGroup -AddRole "Full Control“
Add-PnPUserToGroup -LoginName $siteOwner.Email -Identity $ownersGroup
Wraps CSOM methods and objects
New-PnPTenantSite -Title $item.Title -Url $siteLocation -Owner
$siteOwner.Email -TimeZone 11 -Description $siteDescription -Template
$siteTemplate –Wait
New-PnPWeb -Title $item.Title -Url $webLocation -Template $siteTemplate -Web
$parentWeb -Locale 1033 -BreakInheritance
PnP
PowerShell
Demo
PnP PowerShell
How to get ahold of me?
Brian Caauwe
• Email: bcaauwe@avtex.com
• Twitter: @bcaauwe
• SlideShare: https://www.slideshare.net/BrianCaauwe
• Microsoft Tech Community:
https://techcommunity.microsoft.com/t5/user/viewprofilepage/user-id/2831
• MNSPUG: http://www.sharepointmn.com
Resources
• Windows PowerShell for SharePoint 2013
• https://technet.microsoft.com/en-us/library/ee662539.aspx
• Office Dev Patterns and Practices GitHub
• https://github.com/SharePoint/PnP
• PnP PowerShell
• https://github.com/sharepoint/pnp-powershell/
• SharePoint Server 2013 Client Components SDK
• http://www.microsoft.com/en-us/download/details.aspx?id=35585
• SharePoint Online Management Shell
• http://www.microsoft.com/en-us/download/details.aspx?id=35588
• Display a list of OneDrive for Business Site Collections
• https://technet.microsoft.com/en-us/library/dn911464.aspx
• Using Lambda Expressions with CSOM in PowerShell
• http://www.itunity.com/article/loading-specific-values-lambda-expressions-sharepoint-csom-
api-windows-powershell-1249
SPSSTL - PowerShell - Through the SharePoint Looking Glass

Weitere ähnliche Inhalte

Was ist angesagt?

SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIsJohn Calvert
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIChris Beckett
 
Workshop supermodel munich
Workshop supermodel munichWorkshop supermodel munich
Workshop supermodel munichSonja Madsen
 
Service Workers for Performance
Service Workers for PerformanceService Workers for Performance
Service Workers for PerformancePatrick Meenan
 
Share point hosted add ins munich
Share point hosted add ins munichShare point hosted add ins munich
Share point hosted add ins munichSonja Madsen
 
Firebase - A real-time server
Firebase - A real-time serverFirebase - A real-time server
Firebase - A real-time serverAneeq Anwar
 
GitHub and Office 365 video Munich
GitHub and Office 365 video MunichGitHub and Office 365 video Munich
GitHub and Office 365 video MunichSonja Madsen
 
Web Development with NodeJS
Web Development with NodeJSWeb Development with NodeJS
Web Development with NodeJSRiza Fahmi
 
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)NexThoughts Technologies
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery GuideMark Rackley
 
Firebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: KeynoteFirebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: KeynoteSittiphol Phanvilai
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and ExperiencedAngular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experiencedrajkamaltibacademy
 
Resource Oriented Design
Resource Oriented DesignResource Oriented Design
Resource Oriented DesignGabriele Lana
 
Rev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best PracticesRev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best PracticesSPC Adriatics
 
Migrating to share point online using microsoft tools
Migrating to share point online using microsoft toolsMigrating to share point online using microsoft tools
Migrating to share point online using microsoft toolsspsnyc
 

Was ist angesagt? (19)

SharePoint 2013 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
 
Workshop supermodel munich
Workshop supermodel munichWorkshop supermodel munich
Workshop supermodel munich
 
Service Workers for Performance
Service Workers for PerformanceService Workers for Performance
Service Workers for Performance
 
Share point hosted add ins munich
Share point hosted add ins munichShare point hosted add ins munich
Share point hosted add ins munich
 
Firebase - A real-time server
Firebase - A real-time serverFirebase - A real-time server
Firebase - A real-time server
 
GitHub and Office 365 video Munich
GitHub and Office 365 video MunichGitHub and Office 365 video Munich
GitHub and Office 365 video Munich
 
Web Development with NodeJS
Web Development with NodeJSWeb Development with NodeJS
Web Development with NodeJS
 
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
Grails Plugins(Console, DB Migration, Asset Pipeline and Remote pagination)
 
(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide(Updated) SharePoint & jQuery Guide
(Updated) SharePoint & jQuery Guide
 
Firebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: KeynoteFirebase Dev Day Bangkok: Keynote
Firebase Dev Day Bangkok: Keynote
 
Angular Tutorial Freshers and Experienced
Angular Tutorial Freshers and ExperiencedAngular Tutorial Freshers and Experienced
Angular Tutorial Freshers and Experienced
 
Resource Oriented Design
Resource Oriented DesignResource Oriented Design
Resource Oriented Design
 
Azure full
Azure fullAzure full
Azure full
 
Rev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best PracticesRev Your Engines: SharePoint Performance Best Practices
Rev Your Engines: SharePoint Performance Best Practices
 
Service worker API
Service worker APIService worker API
Service worker API
 
Migrating to share point online using microsoft tools
Migrating to share point online using microsoft toolsMigrating to share point online using microsoft tools
Migrating to share point online using microsoft tools
 
Introducing Firebase by Google
Introducing Firebase by GoogleIntroducing Firebase by Google
Introducing Firebase by Google
 
Firebase hosting
Firebase hostingFirebase hosting
Firebase hosting
 

Ähnlich wie SPSSTL - PowerShell - Through the SharePoint Looking Glass

SPO Migration - New API
SPO Migration - New APISPO Migration - New API
SPO Migration - New APIAshish Trivedi
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Mohan Arumugam
 
PowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and ServersPowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and ServersGreg McMurray
 
Office 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenOffice 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenSébastien Levert
 
Operacion Guinda 2
Operacion Guinda 2Operacion Guinda 2
Operacion Guinda 2Red RADAR
 
Powershell to the People #suguk
Powershell to the People #sugukPowershell to the People #suguk
Powershell to the People #sugukChris McKinley
 
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...Comunidade Portuguesa de SharePoiint
 
The Path through SharePoint Migrations
The Path through SharePoint MigrationsThe Path through SharePoint Migrations
The Path through SharePoint MigrationsBrian Caauwe
 
[Vončina] Configuring SharePoint 2016 for BI Scenarios
[Vončina] Configuring SharePoint 2016 for BI Scenarios[Vončina] Configuring SharePoint 2016 for BI Scenarios
[Vončina] Configuring SharePoint 2016 for BI ScenariosEuropean Collaboration Summit
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauSpiffy
 
The Power of Document Generation with Nintex
The Power of Document Generation with NintexThe Power of Document Generation with Nintex
The Power of Document Generation with NintexBrian Caauwe
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Roy de Kleijn
 
Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and OrchestratorAutomating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and OrchestratorDigicomp Academy AG
 
The Path Through SharePoint Migrations
The Path Through SharePoint MigrationsThe Path Through SharePoint Migrations
The Path Through SharePoint MigrationsBrian Caauwe
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutionswoutervugt
 
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...Sébastien Levert
 
An Introduction to the Office 365 Patterns and Practices Project
An Introduction to the Office 365 Patterns and Practices ProjectAn Introduction to the Office 365 Patterns and Practices Project
An Introduction to the Office 365 Patterns and Practices ProjectSPC Adriatics
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013Kiril Iliev
 

Ähnlich wie SPSSTL - PowerShell - Through the SharePoint Looking Glass (20)

SPO Migration - New API
SPO Migration - New APISPO Migration - New API
SPO Migration - New API
 
Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013Power Shell and Sharepoint 2013
Power Shell and Sharepoint 2013
 
PowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and ServersPowerShell Basics for Office Apps and Servers
PowerShell Basics for Office Apps and Servers
 
Office 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heavenOffice 365 & PowerShell - A match made in heaven
Office 365 & PowerShell - A match made in heaven
 
Operacion Guinda 2
Operacion Guinda 2Operacion Guinda 2
Operacion Guinda 2
 
Powershell to the People #suguk
Powershell to the People #sugukPowershell to the People #suguk
Powershell to the People #suguk
 
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
SPugPt Meeting 35: Manage govern and drive adoption of share point online wit...
 
The Path through SharePoint Migrations
The Path through SharePoint MigrationsThe Path through SharePoint Migrations
The Path through SharePoint Migrations
 
[Vončina] Configuring SharePoint 2016 for BI Scenarios
[Vončina] Configuring SharePoint 2016 for BI Scenarios[Vončina] Configuring SharePoint 2016 for BI Scenarios
[Vončina] Configuring SharePoint 2016 for BI Scenarios
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
The Power of Document Generation with Nintex
The Power of Document Generation with NintexThe Power of Document Generation with Nintex
The Power of Document Generation with Nintex
 
06 web api
06 web api06 web api
06 web api
 
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016Improving Your Selenium WebDriver Tests - Belgium testing days_2016
Improving Your Selenium WebDriver Tests - Belgium testing days_2016
 
Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and OrchestratorAutomating OSD and Post-OSD Configuration with Powershell and Orchestrator
Automating OSD and Post-OSD Configuration with Powershell and Orchestrator
 
Deploying SharePoint @ Cloud
Deploying SharePoint @ CloudDeploying SharePoint @ Cloud
Deploying SharePoint @ Cloud
 
The Path Through SharePoint Migrations
The Path Through SharePoint MigrationsThe Path Through SharePoint Migrations
The Path Through SharePoint Migrations
 
Hdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed SolutionsHdv309 - Real World Sandboxed Solutions
Hdv309 - Real World Sandboxed Solutions
 
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
SharePoint Saturday Ottawa 2015 - Office 365 and PowerShell - A match made in...
 
An Introduction to the Office 365 Patterns and Practices Project
An Introduction to the Office 365 Patterns and Practices ProjectAn Introduction to the Office 365 Patterns and Practices Project
An Introduction to the Office 365 Patterns and Practices Project
 
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
jsSaturday - PhoneGap and jQuery Mobile for SharePoint 2013
 

Mehr von Brian Caauwe

SPSLA - What to Expect with SharePoint 2019
SPSLA - What to Expect with SharePoint 2019SPSLA - What to Expect with SharePoint 2019
SPSLA - What to Expect with SharePoint 2019Brian Caauwe
 
WISPUG - Fun with SharePoint Migrations
WISPUG - Fun with SharePoint MigrationsWISPUG - Fun with SharePoint Migrations
WISPUG - Fun with SharePoint MigrationsBrian Caauwe
 
SPSSTL - Understanding the Collaboration Toolkit
SPSSTL - Understanding the Collaboration Toolkit SPSSTL - Understanding the Collaboration Toolkit
SPSSTL - Understanding the Collaboration Toolkit Brian Caauwe
 
SPSSTL - Content Management Internals
SPSSTL - Content Management Internals SPSSTL - Content Management Internals
SPSSTL - Content Management Internals Brian Caauwe
 
SPSSTL - Building Search Driven Applications
SPSSTL - Building Search Driven ApplicationsSPSSTL - Building Search Driven Applications
SPSSTL - Building Search Driven ApplicationsBrian Caauwe
 
Building Search Driven Applications
Building Search Driven ApplicationsBuilding Search Driven Applications
Building Search Driven ApplicationsBrian Caauwe
 
Demystifying Workflow
Demystifying WorkflowDemystifying Workflow
Demystifying WorkflowBrian Caauwe
 

Mehr von Brian Caauwe (7)

SPSLA - What to Expect with SharePoint 2019
SPSLA - What to Expect with SharePoint 2019SPSLA - What to Expect with SharePoint 2019
SPSLA - What to Expect with SharePoint 2019
 
WISPUG - Fun with SharePoint Migrations
WISPUG - Fun with SharePoint MigrationsWISPUG - Fun with SharePoint Migrations
WISPUG - Fun with SharePoint Migrations
 
SPSSTL - Understanding the Collaboration Toolkit
SPSSTL - Understanding the Collaboration Toolkit SPSSTL - Understanding the Collaboration Toolkit
SPSSTL - Understanding the Collaboration Toolkit
 
SPSSTL - Content Management Internals
SPSSTL - Content Management Internals SPSSTL - Content Management Internals
SPSSTL - Content Management Internals
 
SPSSTL - Building Search Driven Applications
SPSSTL - Building Search Driven ApplicationsSPSSTL - Building Search Driven Applications
SPSSTL - Building Search Driven Applications
 
Building Search Driven Applications
Building Search Driven ApplicationsBuilding Search Driven Applications
Building Search Driven Applications
 
Demystifying Workflow
Demystifying WorkflowDemystifying Workflow
Demystifying Workflow
 

Kürzlich hochgeladen

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 

Kürzlich hochgeladen (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

SPSSTL - PowerShell - Through the SharePoint Looking Glass

  • 1. PowerShell: Through the SharePoint Looking Glass Brian Caauwe – Manager, Business Productivity January 20th, 2018
  • 3. Who am I? • Brian Caauwe • Manager, Consultant, Speaker and new dad of 2 • Email: bcaauwe@avtex.com • Twitter: @bcaauwe • Technical Editor • Professional SharePoint 2013 Administration • Certifications • MCM: SharePoint Server 2010 • MCSM: SharePoint
  • 4. Gold Sponsors SHAREPOINT SATURDAY ST.LOUIS 2018 Silver Sponsors Bronze Sponsors
  • 5. SharePoint Environment Poll • SharePoint 2007 • SharePoint 2010 • SharePoint 2013 • SharePoint 2016 • SharePoint Online
  • 6.
  • 11. • ALWAYS run “As Administrator” • Uses powershell.exe under Windowssystem32 • Microsoft.SharePoint.Powershell snap-in – C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15[6]CONFIGPOWERSHELLRegistrationsharepoint.ps1 • Sets ExecutionPolicy to RemoteSigned • 700+ Cmdlets – SharePoint 2013 • 800+ Cmdlets – SharePoint 2016 Management Shell On-Premise
  • 12. • Microsoft.SharePoint namespace • Server Architecture • SPFarm • SPWebApplication • SPContentDatabase • Site Architecture • SPSite • SPWeb • SPList • SPListItem • MSDN Resource • https://msdn.microsoft.com/en-us/library/jj193058.aspx Server Side Object Model
  • 13. • Uses powershell.exe same as on-prem • Imports the module • Microsoft.Online.SharePoint.PowerShell • Sets ExecutionPolicy to RemoteSigned • Only 42 Cmdlets • Also includes 84 Cmdlets for Azure AD Module • Supplement • Client Side Object Model (CSOM) • Patterns and Practices (PnP) Management Shell Online
  • 14. • Microsoft.SharePoint.Client namespace • Starting Point • Microsoft.SharePoint.Client.ClientContext • Microsoft.SharePoint.Client.SharePointOnlineCredentials • Microsoft.SharePoint.Client.Web • Microsoft.SharePoint.Client.Site • MSDN Resource • https://msdn.microsoft.com/en- us/library/microsoft.sharepoint.client.aspx Client Side Object Model
  • 15. • Call PowerShell from Windowssystem32 • Register Microsoft.SharePoint.Powershell snap-in -psconsolefile “C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions15[6]CONFIGPOWERSHELL Registrationpsconsole.psc1” • Call Script -command “E:PowerShellSet-ScriptName.ps1” • Logging Scheduled Tasks
  • 16. Memory Leaks • Disposable Objects $web.Dispose() $site.Dispose() • SPAssignment – Garbage Collector Global Start-SPAssignment -Global Get-SPSite –Limit All | Get-SPWeb | Select Url, WebTemplate, WebTemplateId Stop-SPAssignment -Global Scoped $w = Get-SPWebApplication http://www.company.com $siteScope = Start-SPAssignment foreach ($site in ($siteScope | Get-SPSite -Limit All –WebApplication $)) { $webScope = Start-SPAssignment foreach ($web in ($webScope | Get-SPWeb -Limit All -Site $site)) { ## Do Something } Stop-SPAssignment $webScope } Stop-SPAssignment $siteScope
  • 17. • Other Assemblies • IIS (WebAdministration) • SQL • Exchange • User Profile • Microsoft.Office.Server.UserProfiles • Managed Metadata • Microsoft.SharePoint.Taxonomy
  • 19. • High Level Cmdlets • Get-SPWebApplication • Get-SPSite • Get-SPWeb Day-to-Day $w = Get-SPWebApplication http://my.company.com $site = Get-SPSite http://my.company.com $site | Get-SPWeb -Limit All
  • 20. • Will utilize Log Cmdlets • New-SPLogFile • Merge-SPLogFile Troubleshooting New-SPLogFile Merge-SPLogFile –Path “C:Debugerror.log” –Correlation 470a4ec2-985d-43be-a14e-176eb1c39672
  • 21. • Will utilize SPSolution Cmdlets • Add-SPSolution • Get-SPSolution • Install-SPSolution Customizations Add-SPSolution –LiteralPath “C:Solutionsspcmis.wsp” $sol = Get-SPSolution | ?{$_.Name –eq “spcmis.wsp”} $sol | Install-SPSolution –GACDeployment –AllWebApplications –Compatibilitylevel All
  • 22. • End users request a site into a list • Automate site creation • Inform user of progress • Enforce Governance Site Request
  • 23. Site Request Lay of the land… • List Location: http://portal.lab.com • List Title: Site Requests • Columns: • Title* (Single line of text) • Abbreviation* (Single line of text) • Site Description (Multiple lines of text) • Site Type* (Choice) • Size* (Choice) • Site Owner* (Person) • Secondary Owner* (Person) • Site Contributors (Person-Multi) • Site Visitors (Person-Multi) • Status (Choice) [Hidden] • Default Value [Submitted] • Status Description (Multiple lines of text) [Hidden] * Required Fields
  • 26. • Utilize Cmdlet • Connect-SPOService Connecting Connect-SPOService –url https://tenant-admin.sharepoint.com
  • 27. • Limited Cmdlets • Get/Set-SPOSite • Get/Set/Remove-SPOUser Day-to-Day $site = Get-SPSite https://[tenant].sharepoint.com Set-SPOUser -LoginName user@email.com -Site $site -IsSiteCollectionAdmin $true
  • 29. • Everything starts with the Client Context Client Side Object Model $username = “user@email.com” $password = ConvertTo-SecureString -String “pass@word1” -AsPlainText -Force $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($url) $ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
  • 30. • Using Load and ExecuteQuery to use objects Client Side Object Model $web = $ctx.Web $site = $ctx.Site $ctx.Load($web) $ctx.Load($site) $ctx.ExecuteQuery()
  • 31. $creds = New-Object System.Management.Automation.PSCredential “user@email.com”, (ConvertTo-SecureString “pass@word1” -AsPlainText -force) Connect-PnPOnline –Url $url –Credentials $creds $ctx = Get-PnPContext $ctx.RequestTimeout = [System.Threading.Timeout]::Infinite $root = Get-PnPWeb Starts with the Connect-PnPOnline Revolves around PnPContext PnP PowerShell
  • 32. $provisioningList = Get-PnPList -Identity $listName $query = "<View><Query><Where><Eq><FieldRef Name='Status'></FieldRef><Value Type='Text'>Submitted</Value></Eq></Where></Query></View>" $items = Get-PnPListItem -List $provisioningList -Query $query Set-PnPListItem -List "Provisioning List" -Identity $item.Id -Values @{"Status"="In Progress";"StatusDescription"="Starting site creation process"} New-PnPGroup -Title $ownerGroupName -Owner $siteOwner.Email Get-PnPGroup -AssociatedOwnerGroup -Web $web Set-PnPGroup -Identity $ownersGroup -SetAssociatedGroup Owners Set-PnPGroupPermissions -Identity $ownersGroup -AddRole "Full Control“ Add-PnPUserToGroup -LoginName $siteOwner.Email -Identity $ownersGroup Wraps CSOM methods and objects New-PnPTenantSite -Title $item.Title -Url $siteLocation -Owner $siteOwner.Email -TimeZone 11 -Description $siteDescription -Template $siteTemplate –Wait New-PnPWeb -Title $item.Title -Url $webLocation -Template $siteTemplate -Web $parentWeb -Locale 1033 -BreakInheritance PnP PowerShell
  • 34.
  • 35. How to get ahold of me? Brian Caauwe • Email: bcaauwe@avtex.com • Twitter: @bcaauwe • SlideShare: https://www.slideshare.net/BrianCaauwe • Microsoft Tech Community: https://techcommunity.microsoft.com/t5/user/viewprofilepage/user-id/2831 • MNSPUG: http://www.sharepointmn.com
  • 36. Resources • Windows PowerShell for SharePoint 2013 • https://technet.microsoft.com/en-us/library/ee662539.aspx • Office Dev Patterns and Practices GitHub • https://github.com/SharePoint/PnP • PnP PowerShell • https://github.com/sharepoint/pnp-powershell/ • SharePoint Server 2013 Client Components SDK • http://www.microsoft.com/en-us/download/details.aspx?id=35585 • SharePoint Online Management Shell • http://www.microsoft.com/en-us/download/details.aspx?id=35588 • Display a list of OneDrive for Business Site Collections • https://technet.microsoft.com/en-us/library/dn911464.aspx • Using Lambda Expressions with CSOM in PowerShell • http://www.itunity.com/article/loading-specific-values-lambda-expressions-sharepoint-csom- api-windows-powershell-1249

Hinweis der Redaktion

  1. You won’t learn by books or sessions Find YOUR practical applications
  2. Use Get-Help for information on Cmdlets Full property for verbose information Examples for… Examples