SlideShare a Scribd company logo
1 of 29
SharePoint PowerShell
for the Admin & Developer
A Venn Diagram Experience
#DogFoodCon

Ryan Dennis | Ricardo Wilkins
What we’re barking about
What is PowerShell?
PowerShell and SharePoint – the evolution
Scripts vs. code – comparison
Business case walk through
Code integration with PowerShell
Architectural discussions

#DogFoodCon
Meet the Mutts
Ryan Dennis

Ricardo Wilkins

Consultant, Blue Chip Consulting Group Consultant, Blue Chip Consulting Group

#DogFoodCon
What’s Your Breed?

#DogFoodCon
What is PowerShell?
…is a task-based command-line shell and
scripting language designed especially for
Windows system administration
…has a task-based scripting language

…includes powerful object manipulation
capabilities
…is built on the .NET Framework
#DogFoodCon
PowerShell deals with Objects,
not Strings
• In order to find out what you can and cannot do or
see on an object, use the Get-Member cmdlet
• Get-Member will return all Methods and Properties
associated with whatever item you pass to it
• PowerShell uses a Verb-Noun syntax for its Cmdlets
• Get-Something
• Set-Something
• New-Something
#DogFoodCon
The Pipeline
• PowerShell passes objects, that is – when you do
something like Get-Process, you’re retrieving process
object(s) – you can then pipe that output, or that
process object to Stop-Process, Select-Object, WhereObject, etc.

• Use the built-in $_ variable to get values from the
current object in the pipeline…
• Let’s talk about this metaphorically… 
#DogFoodCon
The Pipeline

#DogFoodCon
SharePoint 2010 Cmdlets
• 500+ Cmdlets…
• MUCH better than STSADM.exe…

• Can automate complete installations and
configurations…

• Still doesn’t answer every scenario, leaving
gaps in functionality…
• Example: Get, New and Remove SharePoint Groups –
no cmdlet, easy to write a custom function though…
#DogFoodCon
As a Developer, why do I
care?
• Not always necessary to write code
• Use PowerShell to handle things you could
do in C#
• Don’t write console apps, write PowerShell
Scripts!

• Some clients don’t allow managed code
deployments, but PowerShell is A-OK
#DogFoodCon
Managing Solutions & Features
Farm Solutions
•
•
•
•
•

Add-SPSolution
Get-SPSolution
Install-SPSolution
Remove-SPSolution
RemoveSPSolutionDeployme
ntLock
• Uninstall-SPSolution
• Update-SPSolution

#DogFoodCon

Sandboxed Solutions
• Add-SPUserSolution
• Get-SPUserSolution
• InstallSPUserSolution
• RemoveSPUserSolution
• UninstallSPUserSolution
• UpdateSPUserSolution

Features
•
•
•
•
•

Disable-SPFeature
Enable-SPFeature
Get-SPFeature
Install-SPFeature
Uninstall-SPFeature
Retrieving SharePoint Objects
• Multiple ways to get a Site Object using
PowerShell…
• $Site = Get-SPSite
• $Site = New-Object Microsoft.SharePoint.SPSite($Url)

• Multiple ways to get a Web Object using
PowerShell…
• $Web = $Site.RootWeb
• $Web = $Site.OpenWeb()
• $Web = Get-SPWeb
#DogFoodCon
The Evolution of SP Scripting

• About 200 cmds
• Over 500
• Over 700
• No native support
PowerShell cmdlets
PowerShell cmdlets
for PowerShell*
• PowerShell Version • PowerShell Version
• STSADM was it
2.0
3.0

#DogFoodCon
*You could use PowerShell by loading the Microsoft.SharePoint Assembly…
Pros & Cons of Script vs.
Code
Script Pros
Quicker to write
Easier to edit (open a file,
edit it)
No need to install a DLL to
the server
Can access the hundreds
(thousands?) of other
PowerShell cmdlets
(Processes, Services, etc.)
#DogFoodCon

Code Cons
Requires more time to
develop& deploy
Editing requires
redeployment to server
Requires a DLL
installation
C# vs. PowerShell
// register controls
protected TextBox TextBoxMinutesPerSession;
protected LinkButton LinkButtonUpdate;
// Create a click event handler
LinkButtonUpdate.Click
+= new EventHandler(LinkButtonUpdate_Click);
void LinkButtonUpdate_Click(object sender, EventArgs e)
Both code snippets add or set the
{
// Grab the site and web Guid
“CurrentUserSessionDuration”
Guid sitedId = SPContext.Current.Site.ID;
property in a Web.
Guid webID = SPContext.Current.Web.ID;
//create and dispose of spweb and spsite objects
using (SPSite oSPSite = new SPSite(sitedId))
{
using (SPWeb oWeb = oSPSite.OpenWeb(webID))
{
//Set the custom web property to the textbox
value
oWeb.Properties["CurrentUserSessionDuration"]
= TextBoxMinutesPerSession.Text;
oWeb.Properties.Update();
}
$web = Get-SPWeb http://url
}
$web.Properties["CurrentUserSessionDuration"] = "60"
}
$web.Properties.Update()
$web.Dispose()

#DogFoodCon
The Business Case

#DogFoodCon
The Personas
Developer

#DogFoodCon

Admin

Business
Analyst /
Project
Manager
Get-Process –Name “Demo” | Start-Process

#DogFoodCon
Developer + PS
IIS Server
SharePoint
Call
PowerShell
SPList
Log
ListItems

#DogFoodCon

Change
Titles

PS1
SharePoint

-Classic Web Part
-Visual Web Part
-SP2013 App Part

#DogFoodCon
Call
PowerShell

#DogFoodCon
Call
PowerShell

#DogFoodCon

http://ilovesharepoint.codeplex.com/wikipage?title=Execute%20PowerShell%20Script%20Action
-Files reside in e.g. C:Scripts
-Scripts calling scripts as functions
-Storing scripts in source control (TFS)
-BA/PM viewing scripts vs code
#DogFoodCon
SPList
Log
ListItems

function Write-SPAppLogItem {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)][System.String]$WebUrl,
[Parameter(Mandatory=$true)][System.String]$ListName
)
$web = Get-SPWeb $WebUrl
$list = $web.Lists[$ListName]
$item = $list.Items.Add()
$date = Get-Date
$item["Title"] = "Operation completed successfully:
$date"
$item.Update()
$web.Dispose()
}

#DogFoodCon
SPList
Log
ListItems

-BA/PM responsible for this list
-Workflow can kickoff on New Item
-Other apps, or Search, can pull from this list
#DogFoodCon
Why is this worth chewing on?
Separation of Devs vs Ops
Devs maintain the UI
Ops maintains the Title Change process

Separation of Concerns / Single
Responsibility pattern

#DogFoodCon
Other things to chew on?
PS in Office 365
PS in Azure
PS Remoting
PS Workflow

#DogFoodCon
Barks from the Pack
Thoughts?
Would this model work for you?
Other ideas?

#DogFoodCon
>Get-Questions

#DogFoodCon

More Related Content

What's hot

Custom Applications - What, When, and Why
Custom Applications - What, When, and WhyCustom Applications - What, When, and Why
Custom Applications - What, When, and Why
Greg Hurlman
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
KMS Technology
 
Capybara-Webkit
Capybara-WebkitCapybara-Webkit
Capybara-Webkit
bostonrb
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
Brandon Keepers
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
 

What's hot (20)

Best Practices in SharePoint Development - Just Freakin Work! Overcoming Hurd...
Best Practices in SharePoint Development - Just Freakin Work! Overcoming Hurd...Best Practices in SharePoint Development - Just Freakin Work! Overcoming Hurd...
Best Practices in SharePoint Development - Just Freakin Work! Overcoming Hurd...
 
Custom Applications - What, When, and Why
Custom Applications - What, When, and WhyCustom Applications - What, When, and Why
Custom Applications - What, When, and Why
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
 
Extending WordPress as a pro
Extending WordPress as a proExtending WordPress as a pro
Extending WordPress as a pro
 
Behavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using CucumberBehavior Driven Development and Automation Testing Using Cucumber
Behavior Driven Development and Automation Testing Using Cucumber
 
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember DataIn The Trenches With Tomster, Upgrading Ember.js & Ember Data
In The Trenches With Tomster, Upgrading Ember.js & Ember Data
 
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas VochtenO365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
O365Con18 - Working with PowerShell, VS Code and GitHub - Thomas Vochten
 
Intro to SharePoint + PowerShell
Intro to SharePoint + PowerShellIntro to SharePoint + PowerShell
Intro to SharePoint + PowerShell
 
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
 
A 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developersA 20 minute introduction to AngularJS for XPage developers
A 20 minute introduction to AngularJS for XPage developers
 
BDD in Java using Cucumber
BDD in Java using CucumberBDD in Java using Cucumber
BDD in Java using Cucumber
 
Integration Testing with Selenium
Integration Testing with SeleniumIntegration Testing with Selenium
Integration Testing with Selenium
 
Pantheon basics
Pantheon basicsPantheon basics
Pantheon basics
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
 
Fluxible
FluxibleFluxible
Fluxible
 
"Design First" APIs with Swagger
"Design First" APIs with Swagger"Design First" APIs with Swagger
"Design First" APIs with Swagger
 
Capybara-Webkit
Capybara-WebkitCapybara-Webkit
Capybara-Webkit
 
Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!Mock Servers - Fake All the Things!
Mock Servers - Fake All the Things!
 
Behavior Driven Development with Cucumber
Behavior Driven Development with CucumberBehavior Driven Development with Cucumber
Behavior Driven Development with Cucumber
 
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
 

Viewers also liked

Make a better social collaboration platform with share point 2013
Make a better social collaboration platform with share point 2013Make a better social collaboration platform with share point 2013
Make a better social collaboration platform with share point 2013
Thuan Ng
 
Basics of SharePoint
Basics of SharePointBasics of SharePoint
Basics of SharePoint
samirsangli
 
SharePoint 2010 overview
SharePoint 2010 overviewSharePoint 2010 overview
SharePoint 2010 overview
Sentri
 
What IS SharePoint Development?
What IS SharePoint Development?What IS SharePoint Development?
What IS SharePoint Development?
Mark Rackley
 
Sp administration-training-prism
Sp administration-training-prismSp administration-training-prism
Sp administration-training-prism
Thuan Ng
 

Viewers also liked (10)

Make a better social collaboration platform with share point 2013
Make a better social collaboration platform with share point 2013Make a better social collaboration platform with share point 2013
Make a better social collaboration platform with share point 2013
 
Getting Started with SharePoint Development
Getting Started with SharePoint DevelopmentGetting Started with SharePoint Development
Getting Started with SharePoint Development
 
Basics of SharePoint
Basics of SharePointBasics of SharePoint
Basics of SharePoint
 
SharePoint Development(Lesson 5)
SharePoint Development(Lesson 5)SharePoint Development(Lesson 5)
SharePoint Development(Lesson 5)
 
Introduction to SharePoint as a Development Platform
Introduction to SharePoint as a Development PlatformIntroduction to SharePoint as a Development Platform
Introduction to SharePoint as a Development Platform
 
SharePoint 2010 overview
SharePoint 2010 overviewSharePoint 2010 overview
SharePoint 2010 overview
 
What IS SharePoint Development?
What IS SharePoint Development?What IS SharePoint Development?
What IS SharePoint Development?
 
Designing SharePoint 2010 for Business
Designing SharePoint 2010 for BusinessDesigning SharePoint 2010 for Business
Designing SharePoint 2010 for Business
 
User Centered Design and SharePoint Publishing Portals
User Centered Design and SharePoint Publishing PortalsUser Centered Design and SharePoint Publishing Portals
User Centered Design and SharePoint Publishing Portals
 
Sp administration-training-prism
Sp administration-training-prismSp administration-training-prism
Sp administration-training-prism
 

Similar to SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience

Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
Joshua Warren
 

Similar to SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience (20)

SharePoint Saturday Cincinnati 2014 - CSOM
SharePoint Saturday Cincinnati 2014 - CSOMSharePoint Saturday Cincinnati 2014 - CSOM
SharePoint Saturday Cincinnati 2014 - CSOM
 
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshopIntroduction to PowerShell - Be a PowerShell Hero - SPFest workshop
Introduction to PowerShell - Be a PowerShell Hero - SPFest workshop
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
 
Build Your First SharePoint Framework Webpart
Build Your First SharePoint Framework WebpartBuild Your First SharePoint Framework Webpart
Build Your First SharePoint Framework Webpart
 
Introducción al SharePoint Framework SPFx
Introducción al SharePoint Framework SPFxIntroducción al SharePoint Framework SPFx
Introducción al SharePoint Framework SPFx
 
How to do everything with PowerShell
How to do everything with PowerShellHow to do everything with PowerShell
How to do everything with PowerShell
 
Jenkins CI for MacDevOps
Jenkins CI for MacDevOpsJenkins CI for MacDevOps
Jenkins CI for MacDevOps
 
WinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release PipelinesWinOps Conf 2016 - Michael Greene - Release Pipelines
WinOps Conf 2016 - Michael Greene - Release Pipelines
 
[Portland 365Sat] PCF Custom Controls
[Portland 365Sat] PCF Custom Controls[Portland 365Sat] PCF Custom Controls
[Portland 365Sat] PCF Custom Controls
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit SoftwaretestsEffizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Introduction to Office Development Topics
Introduction to Office Development TopicsIntroduction to Office Development Topics
Introduction to Office Development Topics
 
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
Office 365 Saturday (Sydney) - SharePoint framework – build integrated user e...
 
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
VMworld 2016: Getting Started with PowerShell and PowerCLI for Your VMware En...
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
 
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...
 
Dancing with websocket
Dancing with websocketDancing with websocket
Dancing with websocket
 
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next LevelMWLUG 2015 - AD114 Take Your XPages Development to the Next Level
MWLUG 2015 - AD114 Take Your XPages Development to the Next Level
 
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
 

More from Ricardo Wilkins

Moving Your SharePoint Development to the Cloud
Moving Your SharePoint Development to the CloudMoving Your SharePoint Development to the Cloud
Moving Your SharePoint Development to the Cloud
Ricardo Wilkins
 
SharePoint 2013 Dev Features
SharePoint 2013 Dev FeaturesSharePoint 2013 Dev Features
SharePoint 2013 Dev Features
Ricardo Wilkins
 
Cloud Computing Tips for Small Business
Cloud Computing Tips for Small BusinessCloud Computing Tips for Small Business
Cloud Computing Tips for Small Business
Ricardo Wilkins
 
The ABC’s of Building Apps for SharePoint 2013
The ABC’s of Building Apps for SharePoint 2013The ABC’s of Building Apps for SharePoint 2013
The ABC’s of Building Apps for SharePoint 2013
Ricardo Wilkins
 
SharePoint & Azure Integration
SharePoint & Azure IntegrationSharePoint & Azure Integration
SharePoint & Azure Integration
Ricardo Wilkins
 
DevOps - Bridging the gap between development and operations
DevOps - Bridging the gap between development and operationsDevOps - Bridging the gap between development and operations
DevOps - Bridging the gap between development and operations
Ricardo Wilkins
 

More from Ricardo Wilkins (20)

InfoPath - I Ain't Dead Yet!
InfoPath - I Ain't Dead Yet!InfoPath - I Ain't Dead Yet!
InfoPath - I Ain't Dead Yet!
 
Ricardo Wilkins - Modern Work CSM @ Microsoft
Ricardo Wilkins - Modern Work CSM @ MicrosoftRicardo Wilkins - Modern Work CSM @ Microsoft
Ricardo Wilkins - Modern Work CSM @ Microsoft
 
FAQ: Working with Files in Microsoft Teams
FAQ: Working with Files in Microsoft TeamsFAQ: Working with Files in Microsoft Teams
FAQ: Working with Files in Microsoft Teams
 
Top Ten Tips for Teams - Microsoft Teams
Top Ten Tips for Teams - Microsoft TeamsTop Ten Tips for Teams - Microsoft Teams
Top Ten Tips for Teams - Microsoft Teams
 
Microsoft Flow - A Real-World Walkthru
Microsoft Flow - A Real-World WalkthruMicrosoft Flow - A Real-World Walkthru
Microsoft Flow - A Real-World Walkthru
 
Columbus SharePoint User Group - April 2019
Columbus SharePoint User Group - April 2019Columbus SharePoint User Group - April 2019
Columbus SharePoint User Group - April 2019
 
OneNote - The Missing Manual
OneNote - The Missing ManualOneNote - The Missing Manual
OneNote - The Missing Manual
 
Teams - The Missing Manual
Teams - The Missing ManualTeams - The Missing Manual
Teams - The Missing Manual
 
Microsoft Teams - The Missing Manual
Microsoft Teams - The Missing ManualMicrosoft Teams - The Missing Manual
Microsoft Teams - The Missing Manual
 
SharePoint Cincy 2018 - Site Management - Notes from the Field
SharePoint Cincy 2018 - Site Management - Notes from the FieldSharePoint Cincy 2018 - Site Management - Notes from the Field
SharePoint Cincy 2018 - Site Management - Notes from the Field
 
OneNote Overview
OneNote OverviewOneNote Overview
OneNote Overview
 
SharePoint, PowerApps, Flow and Azure Functions - What Does It All Mean?
SharePoint, PowerApps, Flow and Azure Functions - What Does It All Mean?SharePoint, PowerApps, Flow and Azure Functions - What Does It All Mean?
SharePoint, PowerApps, Flow and Azure Functions - What Does It All Mean?
 
When Your CISO Says No - Security & Compliance in Office 365
When Your CISO Says No - Security & Compliance in Office 365When Your CISO Says No - Security & Compliance in Office 365
When Your CISO Says No - Security & Compliance in Office 365
 
Moving Your SharePoint Development to the Cloud
Moving Your SharePoint Development to the CloudMoving Your SharePoint Development to the Cloud
Moving Your SharePoint Development to the Cloud
 
InfoPath
InfoPathInfoPath
InfoPath
 
SharePoint 2013 Dev Features
SharePoint 2013 Dev FeaturesSharePoint 2013 Dev Features
SharePoint 2013 Dev Features
 
Cloud Computing Tips for Small Business
Cloud Computing Tips for Small BusinessCloud Computing Tips for Small Business
Cloud Computing Tips for Small Business
 
The ABC’s of Building Apps for SharePoint 2013
The ABC’s of Building Apps for SharePoint 2013The ABC’s of Building Apps for SharePoint 2013
The ABC’s of Building Apps for SharePoint 2013
 
SharePoint & Azure Integration
SharePoint & Azure IntegrationSharePoint & Azure Integration
SharePoint & Azure Integration
 
DevOps - Bridging the gap between development and operations
DevOps - Bridging the gap between development and operationsDevOps - Bridging the gap between development and operations
DevOps - Bridging the gap between development and operations
 

Recently uploaded

Recently uploaded (20)

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?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

SharePoint PowerShell for the Admin and Developer - A Venn Diagram Experience

  • 1. SharePoint PowerShell for the Admin & Developer A Venn Diagram Experience #DogFoodCon Ryan Dennis | Ricardo Wilkins
  • 2. What we’re barking about What is PowerShell? PowerShell and SharePoint – the evolution Scripts vs. code – comparison Business case walk through Code integration with PowerShell Architectural discussions #DogFoodCon
  • 3. Meet the Mutts Ryan Dennis Ricardo Wilkins Consultant, Blue Chip Consulting Group Consultant, Blue Chip Consulting Group #DogFoodCon
  • 5. What is PowerShell? …is a task-based command-line shell and scripting language designed especially for Windows system administration …has a task-based scripting language …includes powerful object manipulation capabilities …is built on the .NET Framework #DogFoodCon
  • 6. PowerShell deals with Objects, not Strings • In order to find out what you can and cannot do or see on an object, use the Get-Member cmdlet • Get-Member will return all Methods and Properties associated with whatever item you pass to it • PowerShell uses a Verb-Noun syntax for its Cmdlets • Get-Something • Set-Something • New-Something #DogFoodCon
  • 7. The Pipeline • PowerShell passes objects, that is – when you do something like Get-Process, you’re retrieving process object(s) – you can then pipe that output, or that process object to Stop-Process, Select-Object, WhereObject, etc. • Use the built-in $_ variable to get values from the current object in the pipeline… • Let’s talk about this metaphorically…  #DogFoodCon
  • 9. SharePoint 2010 Cmdlets • 500+ Cmdlets… • MUCH better than STSADM.exe… • Can automate complete installations and configurations… • Still doesn’t answer every scenario, leaving gaps in functionality… • Example: Get, New and Remove SharePoint Groups – no cmdlet, easy to write a custom function though… #DogFoodCon
  • 10. As a Developer, why do I care? • Not always necessary to write code • Use PowerShell to handle things you could do in C# • Don’t write console apps, write PowerShell Scripts! • Some clients don’t allow managed code deployments, but PowerShell is A-OK #DogFoodCon
  • 11. Managing Solutions & Features Farm Solutions • • • • • Add-SPSolution Get-SPSolution Install-SPSolution Remove-SPSolution RemoveSPSolutionDeployme ntLock • Uninstall-SPSolution • Update-SPSolution #DogFoodCon Sandboxed Solutions • Add-SPUserSolution • Get-SPUserSolution • InstallSPUserSolution • RemoveSPUserSolution • UninstallSPUserSolution • UpdateSPUserSolution Features • • • • • Disable-SPFeature Enable-SPFeature Get-SPFeature Install-SPFeature Uninstall-SPFeature
  • 12. Retrieving SharePoint Objects • Multiple ways to get a Site Object using PowerShell… • $Site = Get-SPSite • $Site = New-Object Microsoft.SharePoint.SPSite($Url) • Multiple ways to get a Web Object using PowerShell… • $Web = $Site.RootWeb • $Web = $Site.OpenWeb() • $Web = Get-SPWeb #DogFoodCon
  • 13. The Evolution of SP Scripting • About 200 cmds • Over 500 • Over 700 • No native support PowerShell cmdlets PowerShell cmdlets for PowerShell* • PowerShell Version • PowerShell Version • STSADM was it 2.0 3.0 #DogFoodCon *You could use PowerShell by loading the Microsoft.SharePoint Assembly…
  • 14. Pros & Cons of Script vs. Code Script Pros Quicker to write Easier to edit (open a file, edit it) No need to install a DLL to the server Can access the hundreds (thousands?) of other PowerShell cmdlets (Processes, Services, etc.) #DogFoodCon Code Cons Requires more time to develop& deploy Editing requires redeployment to server Requires a DLL installation
  • 15. C# vs. PowerShell // register controls protected TextBox TextBoxMinutesPerSession; protected LinkButton LinkButtonUpdate; // Create a click event handler LinkButtonUpdate.Click += new EventHandler(LinkButtonUpdate_Click); void LinkButtonUpdate_Click(object sender, EventArgs e) Both code snippets add or set the { // Grab the site and web Guid “CurrentUserSessionDuration” Guid sitedId = SPContext.Current.Site.ID; property in a Web. Guid webID = SPContext.Current.Web.ID; //create and dispose of spweb and spsite objects using (SPSite oSPSite = new SPSite(sitedId)) { using (SPWeb oWeb = oSPSite.OpenWeb(webID)) { //Set the custom web property to the textbox value oWeb.Properties["CurrentUserSessionDuration"] = TextBoxMinutesPerSession.Text; oWeb.Properties.Update(); } $web = Get-SPWeb http://url } $web.Properties["CurrentUserSessionDuration"] = "60" } $web.Properties.Update() $web.Dispose() #DogFoodCon
  • 18. Get-Process –Name “Demo” | Start-Process #DogFoodCon
  • 19. Developer + PS IIS Server SharePoint Call PowerShell SPList Log ListItems #DogFoodCon Change Titles PS1
  • 20. SharePoint -Classic Web Part -Visual Web Part -SP2013 App Part #DogFoodCon
  • 23. -Files reside in e.g. C:Scripts -Scripts calling scripts as functions -Storing scripts in source control (TFS) -BA/PM viewing scripts vs code #DogFoodCon
  • 24. SPList Log ListItems function Write-SPAppLogItem { [CmdletBinding()] Param( [Parameter(Mandatory=$true)][System.String]$WebUrl, [Parameter(Mandatory=$true)][System.String]$ListName ) $web = Get-SPWeb $WebUrl $list = $web.Lists[$ListName] $item = $list.Items.Add() $date = Get-Date $item["Title"] = "Operation completed successfully: $date" $item.Update() $web.Dispose() } #DogFoodCon
  • 25. SPList Log ListItems -BA/PM responsible for this list -Workflow can kickoff on New Item -Other apps, or Search, can pull from this list #DogFoodCon
  • 26. Why is this worth chewing on? Separation of Devs vs Ops Devs maintain the UI Ops maintains the Title Change process Separation of Concerns / Single Responsibility pattern #DogFoodCon
  • 27. Other things to chew on? PS in Office 365 PS in Azure PS Remoting PS Workflow #DogFoodCon
  • 28. Barks from the Pack Thoughts? Would this model work for you? Other ideas? #DogFoodCon

Editor's Notes

  1. http://powerguivsx.codeplex.com/