230 likes | 445 Views
Required Slide. SESSION CODE: OSP402. Windows PowerShell Made Less Scary for the Microsoft SharePoint Server 2010 Administrator . Todd Klindt and Shane Young SharePoint Nerds SharePoint911. Who is this Todd guy?. WSS MVP since 2006 Speaker, writer, consultant, stunt double for Ray Romano
E N D
Required Slide SESSION CODE: OSP402 Windows PowerShell Made Less Scary for the Microsoft SharePoint Server 2010 Administrator Todd Klindt and Shane Young SharePoint Nerds SharePoint911
Who is this Todd guy? • WSS MVP since 2006 • Speaker, writer, consultant, stunt double for Ray Romano • Personal Blogwww.toddklindt.com/blog • E-mailtodd@sharepoint911.com • Twitter me! @toddklindt
Who Am I? • Shane Young • Owner of SharePoint911.com • Microsoft Office SharePoint Server MVP • Consultant, Trainer, Writer, & Speaker • shane@sharepoint911.com • Blog • http://msmvps.com/shane • SharePoint Consulting • http://www.sharepoint911.com • http://twitter.com/shanescows • I am going to run for President when I grow up.
Agenda • What is Windows PowerShell • Windows PowerShell basics • Windows PowerShell scripts for administrators
What is Windows PowerShell? • Command-line interface and scripting language used for SharePoint Server administration • Compliments CMD • Extends STSADM • Uses XML & Objects • Built on the .Net Framework
Why do we care? • Complete command-line system that is far more powerful than any previous Windows-based command-line prompt environment. • Provides: • More Control • More Efficiency • More Productivity
What about STSADM? • STSADM still available to support backwards compatibility • Can leverage it in Windows PowerShell scripts • Whatever STSADM can do, Windows PowerShell can do better! • Ability to run against SQL Snapshots, instead of production. • More granular control for backup / restore.
Windows PowerShell Basics • cmdlet • pronounced "command-let“ • single function that can be used separately or combined with other cmdlets to perform complex tasks and automate administration
Windows PowerShell Basics • cmdlets = verbs (actions) & nouns (objects) • Combine the two to build specific commands • Examples • Get-SPSite • Get = Verb • SPSite = Noun
Getting the list of SharePoint cmdlets • Get a list of all commands: • Get-Command –noun sp* • Get help for a specific command: • Get-Help <cmdlet>
Getting the list of SharePoint cmdlets • For more detailed help add the following parameters: • Get-Help <cmdlet> -full • Get-Help <cmdlet> -examples • Get-Help <cmdlet> -detailed
Noodling around in Windows PowerShell Todd Klindt and Shane YoungSharePoint NerdsSharePoint911 DEMO
PowerShell Scripts • Build scripts to easily execute through common commands and tasks • Develop using PowerShell ISE or other shells • Schedule using Task Scheduler.
PowerShell Scripts • Examples: • Activate a feature across multiple site collections • Provisioning of Managed Accounts • Creating of New Sites • Backup all Site Collections in Farm
Scripting Syntax • Sample Script: • $password = Read-Host "What is the password for all accounts?" -assecurestring ; Get-Content usernames.txt | ForEach-Object {New-SPManagedAccount -password $password -username litwareinc\$_; Set-SPManagedAccount -identity $_ -autogenerate -confirm:$False}
Windows PowerShell scripts in SharePoint Todd Klindt and Shane YoungSharePoint NerdsSharePoint911 DEMO
Additional PowerShell Resources • Windows PowerShell for SharePoint Foundation 2010 • http://technet.microsoft.com/en-us/library/ee662510(office.14).aspx • Windows PowerShell Getting Started Guide • http://msdn.microsoft.com/en-us/library/aa973757(VS.85).aspx • Windows PowerShell Cheat Sheet • http://refcardz.dzone.com/refcardz/windows-powershell • STSADM to Windows PowerShell mapping • http://technet.microsoft.com/en-us/library/ff621084.aspx • Zach Rosenfield’s blog • http://sharepoint.microsoft.com/blogs/zach/default.aspx
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Track Resources For More Information: http://sharepoint.microsoft.com • SharePoint Developer Center: http://msdn.microsoft.com/sharepoint SharePoint Tech Center: http://technet.microsoft.com/sharepoint Official SharePoint Team Blog: http://blogs.msdn.com/sharepoint
Required Slide Resources Learning • Sessions On-Demand & Community • Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet • http://microsoft.com/msdn
Required Slide Speakers, please list the Breakout Sessions, Interactive Sessions, Labs and Demo Stations that are related to your session. Related Content • Breakout Sessions – See Conference Guide for full list of OSP Track Sessions • Interactive Sessions – OSP Track has 10 Interactive Sessions – OSP01-INT – OSP10-INT • Hands-on Labs – OSP01-HOL – OSP20-HOL • Product Demo Stations: Yellow Section, OSP • Office 2010, SharePoint 2010, Project Server 2010, Visio 2010 have kiosks & demos
Required Slide Complete an evaluation on CommNet and enter to win!
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.