SharePoint 2010 Administration using PowerShell Brian Caauwe Senior Consultant – SharePoint – MCTS March 20, 2010.

Slides:



Advertisements
Similar presentations
Painless PowerShell for SharePoint Admins Rick Taylor.
Advertisements

Rick Toner MCSD, MCPD, MCITP Blog:
Gary Lapointe SharePoint MVP.  SharePoint MVP  Blog: 
Jason Himmelstein, MVP Senior Technical Director,
Non-displaying slide…. SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell 55095AC.
James Boother Blog: INTRODUCTION TO POWERSHELL.
James Boother Blog: AUTOMATING ADMIN TASKS WITH POWERSHELL.
Aptillon, Inc. – Director and Founding Partner – SharePoint MVP since January 2008 Blog:
Great people, great experience, great passion Administering SharePoint with Windows PowerShell Go Beyond the Management Shell with SharePoint and Windows.
Fabian Schenker Consultant Microsoft Schweiz ShowerPoint - PowerShell und SharePoint für die Installation und Management von SharePoint 2010 Farmen Thomas.
INTRODUCTION TO POWERSHELL Neil Iversen. Points of Interest  Introduction  Getting Around  Basic Syntax  Making yourself at ~  Not-So-Basic Syntax.
Welcome to the Minnesota SharePoint User Group November 11 th, 2009 SharePoint 2010 Administration Wes Preston, Brian Caauwe.
10 PowerShell Commands Every Admin Should Know David Price.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 7 Configuring File Services in Windows Server 2008.
PowerShell Lessons Learned from Building an Automated SQL Installation and Patch Management Implementation Presented by: Fany Carolina Vargas, Microsoft.
System Center 2012 R2 Windows Azure Pack Service Management Automation 101.
Adding a Module The Import-Module cmdlet  Can be used to load any external module into PowerShell.  Uses the following syntax to add the ActiveDirectory.
WGUiSW IDOL Windows Server 2012 Active Directory: Domain Services What’s new in Active Directory: Domain Services?
© 2007 Asynchrony Solutions, Inc. 1 10/29/07 Introduction to PowerShell Brian Button VP Engineering Asynchrony Solutions, Inc
Managing Citrix Farms Using MFCOM and Powershell.
MS WINDOWS POWER SHELL CSE 535 Operating Systems.
PowerShell Brian Caauwe – Senior Consultant April 14, 2012 The Administrator’s Best Friend.
Windows PowerShell Deep Dive 1 Morgan Simonsen Ementor.
Microsoft ® Official Course Module XA Using Windows PowerShell ®
SharePoint 2010 Development Environment A Guide to Setup SharePoint 2010 Development Environment on Windows 7 Machine.
PowerShell Basics. o PowerShell is a great way to manipulate server and/or workstation components o It’s geared toward system administrators by creating.
Module 3 Administering and Automating SharePoint.
Section 6: Using Windows PowerShell to Manage Group Policy Introducing Windows PowerShell Windows PowerShell Library for Group Policy Windows PowerShell-Based.
December, 21, 2010 Bartek Bielawski Sr IT Site Services Specialist Warsaw, Poland.
Good Morning and Thank You!.  Have some Fun!  Learn at least one thing new!  Make myself available to you So please …  Ask questions and enjoy!
Intro To PowerShell Jack Fruh Sharepointjack.com.
PowerShell for SharePoint Developers and Administrators Michael Blumenthal Magenic Technologies
Online Conference June 17 th and 18 th SharePoint Online Administration with PowerShell.
Cherwell + PowerShell = Powerful Workflow Automation
PowerShell For SharePoint Developers Neil Iversen Inetium
Virtual techdays INDIA │ 9-11 February 2011 Monitoring and managing remote Windows 7 desktops with Windows PowerShell Ravikanth C │ Dell Inc.
Corey Hynes HynesITe, Inc Session Code: SRV317 Objectives Let you walk out of here, being able to run a script against an OU of computers, to make some.
Windows PowerShell Introduction 1 Morgan Simonsen Ementor.
 An alias is an alternative name assigned to a Cmdlet.  Aliases allow users to quickly interact with the shell.  The Cmdlet get-alias is.
Todd Klindt and Shane Young SharePoint911. Who is this Todd guy?
PS SharePoSH:\> SPSite & SPWebs SharePoint + PowerShell User Group November 21, 2012.
 It is Microsoft's new task-based command- line shell and scripting language designed especially for system administration.  It helps Information Technology.
Windows PowerShell. What is Windows PowerShell? A command-line interface (CLI) A new way of developing Windows and other products to be more manageable.
Automating SharePoint 2010 administration tasks with Power Shell Toni Frankola SharePoint MVP, Croatia
Shell script – part 2 CS 302. Special shell variable $0.. $9  Positional parameters or command line arguments  For example, a script myscript take 2.
Module 14: Advanced Topics and Troubleshooting. Microsoft ® Windows ® Small Business Server (SBS) 2008 Management Console (Advanced Mode) Managing Windows.
Introduction to SQL Server Automation with Powershell by Chris Sommer.
Ravikanth C.
Powering up your Office 365 cmdlets with CSOM Bjoern H Rapp, Senior Architect Public Cloud, SopraSteria.
Start-SPPowerShell – Introduction to PowerShell for SharePoint Admins and Developers Paul BAker.
Building Powerful Workflow Automation with Cherwell and PowerShell
PowerShell 101 sharepoint on-premise
Office PowerShell administration
The Administrator’s Best Friend
Preparing for the Windows 8.1 MCSA
PowerShell 2.0 Remoting Ravikanth C.
Introduction to PowerShell
Getting Started with the Data ONTAP PowerShell Toolkit
Introduction to PowerShell
SharePoint Saturday Omaha April 2016
Server Management and Automation Windows Server 2012 R2
PowerShell goodness 2017 Jeremy Sublett Composable Systems, LLC
Making PowerShell Useful
PowerShell Best Practices for SQL DBA’s
Making PowerShell Useful
Building your SharePoint Farm with PowerShell
PowerShell + SharePoint Online – An Admins Guide to Administration in the O365 Cloud Marrell Sanders – Sr. SharePoint Administrator NACS Branson, MO.
Tech Ed North America /27/ :04 AM Required Slide
PowerShell + SharePoint Online – An Admins Guide to Administration in the O365 Cloud Marrell Sanders – Sr. SharePoint Administrator SharePoint Saturday.
Discovering the full power of parameters in Power BI
Presentation transcript:

SharePoint 2010 Administration using PowerShell Brian Caauwe Senior Consultant – SharePoint – MCTS March 20, 2010

Introduction PowerShell Basics PowerShell & SharePoint 2010 Demo Q&A Session Agenda

Brian Caauwe Consultant & Speaker – –Blog: MCTS - SharePoint v3 Who am I?

2 nd Wednesday of the Month –9:00 – 11:30 AM SharePoint resources and links Meeting Schedule Past User Group Presentations This Presentation Next Meeting – 4/14 –Business Process and Digital Forms 2007 / 2010 Minnesota SharePoint User Group

POWERSHELL BASICS

More than just a command prompt Not Exclusive to SharePoint –Exchange 2007 –SQL 2008 –More… Get PowerShell –Windows Server 2003 (KB926139)KB –Windows Server 2008 (Activate Feature) Tab is your friend (auto-complete) Getting Started

Use.NET objects –System.String –System.Int32 –Etc. Access Registry –cd HKLM:\System –cd HKCU:\Software Store Variables –$myArray = “value1”,”value2”,”value3” Supports Complex operations –Loops (For, While) –If / Else –Switch Supports Functions –Function Get-Information([string]$arg) More PowerShell Information

Syntax differences –Operators -lt is Less than (<) -le is Less than or Equal To (<=) -eq is Equivalent (==) -gt is Greater than (>) -ge is Greater than or Equal to (>=) -ne is Not Equal (!=) -or is Logical Or (||) -and is Logical And (&&) ? is Where (Where-Object) –Enums and Static Methods [System.Reflection.Assembly]::LoadWithPartialName(“ Microsoft.SharePoint”) Even More PowerShell Information

File Extension (.ps1) Running Scripts –Call using.\script.ps1 ExecutionPolicy minimum RemoteSigned PowerShell Scripts

Output to Console (Write-Host) Output to File (Out-File) PowerShell Output

Get-Help Get-Member PowerShell Help

POWERSHELL & SP 2010

Uses PowerShell v2.0 –Allows Remote Access Microsoft.SharePoint.PowerShell namespace –Get-Command -pssnapin “Microsoft.SharePoint.PowerShell” | more –Beta2 = ~535 cmdlets Download Help files (.chm) from my BlogBlog SharePoint 2010 Management Shell –*Run as Administrator SharePoint 2010

SharePoint_Shell_Access SQL Server Role –Get-SPShellAdmin –Add-SPShellAdmin Need to be a local admin to run this cmdlet Adds user to WSS_Admin_WPG –Remove-SPShellAdmin SharePoint Shell Administrator

All Cmdlets are Object Model Based –SPSite –SPWeb –Etc… Start-SPAssignment / Stop-SPAssignment –Garbage Collector for Disposable objects –Can be used on variables or globally Use the -WhatIF parameter to see what “would” happen SharePoint 2010 Cmdlet Basics

New-SPConfigurationDatabase (replacing psconfig) Add-SPSolution / Deploy-SPSolution New-SPLogFile Get-SPLogEvent -StartTime (Get- Date).AddHours(-2) -EndTime (Get- Date).AddMinutes(-10) Helpful Cmdlets

Using the Pipe (|) –Joins statements together Get-SPWebApplication | Get- SPSite -Limit All | Get-SPWeb -Limit Allhttp://portal.company.com Get-SPSite | Set-SPSite - SecondaryOwnerAlias DOMAIN\usernamehttp://portal.company.com Advanced Cmdlets

Querying Objects –Get-SPWeb -Filter {$_.Template -eq “Blog"} –Get-SPLogEvent -StartTime (Get- Date).AddHours(-1)| ?{$_.Correlation -eq $guid} | Select Timestamp, Category, Message –Get-SPSite | foreach{New-SPWeb -Url ($_.Url + "/blog") - Template Blog#0} –Get-SPWebApplication | Get-SPSite -Limit All | Get-SPWeb -Limit All | ?{$_.WebTemplate –eq “Blog”} | Select Url, Title, WebTemplateIdhttp://portal.company.com More Advanced Cmdlets

Run Commands on SharePoint servers –Enable-PSRemoting –force –Enable-WSManCredSSP –role Server –force –Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000 Run Commands on local machine –Enable-PSRemoting -force –Enable-WSManCredSSP –role Client –DelegateComputer “*.domain.com or COMPUTERNAME” –force Shared SPModule (\\servername\spmodule) –Zach Rosenfields’s Blog Store Credentials in a variable –$cred = Get-Credential Load Modules –$env:PSModulePath = \\servername\spmodule; + $env:PSModulePath\\servername\spmodule; –Import-Module SPModule.misc –Import-Module SPModule.setup Remote Scripting

DEMO

Q & A

TechNet – Windows PowerShell for SharePoint Server 2010 – us/library/ee662539(office.14).aspxhttp://technet.microsoft.com/en- us/library/ee662539(office.14).aspx TechNet – Getting Started: Windows PowerShell for SharePoint 2010 Administrators – us/sharepoint/ee aspxhttp://technet.microsoft.com/en- us/sharepoint/ee aspx Zach Rosenfield’s Blog – gories/Category.aspx?Name=PowerShellhttp://sharepoint.microsoft.com/blogs/zach/Lists/Cate gories/Category.aspx?Name=PowerShell Brian Caauwe’s Blog – References

A key element to your success.