You are previewing PowerShell™ for SharePoint® 2013 How-To.
O'Reilly logo
PowerShell™ for SharePoint® 2013 How-To

Book Description

Need fast, reliable, easy-to-implement solutions for automating SharePoint 2013 administration with PowerShell? This guide delivers exactly what you’re looking for: step-by-step help and guidance with the tasks you’ll perform most often. You’ll find tested PowerShell scripts and techniques for managing installations, servers, farms, IIS, users, services, sites, data, solutions, enterprise services, search, PerformancePoint business intelligence, and more. This edition adds time-saving techniques for managing user licensing and new SharePoint 2013 service applications, covers new cmdlets, and contains two new reference appendices. This focused resource for scripting SharePoint with PowerShell provides all the answers you need—now!

Fast, Accurate, and Easy to Use!

  • Run PowerShell scripts from the SharePoint 2013 Management Shell console

  • Perform unattended SharePoint installations

  • Configure new farms, add servers, and manage sites

  • Create new site collections and sub-sites

  • Review and set Farm Configuration Values and SharePoint Designer Settings

  • Display, get, create, remove, configure, and extend web applications

  • Create, manage, remove, back up, and restore SharePoint databases

  • Work with SharePoint solutions and features

  • Automatically publish and manage content

  • Establish and change external data connections via Business Data Connectivity Service

  • Control the new versions of Excel, Access, Visio, and Word Services

  • Script Office Web Apps to deliver more robust web/mobile solutions

  • Manage PerformancePoint business intelligence via cmdlets

  • Administer Enterprise Search, InfoPath Form Services, profiles, metadata, and Secure Store

  • Streamline Work Management Services to help users track tasks more efficiently

  • Table of Contents

    1. Title Page
    2. Copyright Page
    3. Table of Contents
    4. About the Author
    5. Acknowledgments
    6. We Want to Hear from You!
    7. Reader Services
    8. Introduction
      1. Overview of This Book
      2. How to Benefit from This Book
      3. How to Continue Expanding Your Knowledge
    9. Chapter 1. SharePoint 2013 Management Shell
      1. How Do I Run PowerShell?
      2. How Do I Make PowerShell Aware of SharePoint?
      3. What Is the SharePoint 2013 Management Shell?
      4. What Is the SharePoint 2013 Management Shell Loading?
    10. Chapter 2. PowerShell Basics
      1. What Is a Cmdlet?
      2. How Can I See the Possible Verbs for a Noun Command?
      3. What Is a Parameter?
      4. What Is a Switch Parameter?
      5. How Can I See the Possible Parameters for a Cmdlet?
      6. What Does F3 Do?
      7. What Does F7 Do?
      8. What Are Console Commands?
      9. Path Environment Variable
      10. Running Unsigned Scripts
      11. Disabling the Confirmation Prompt
      12. Generating Inline Credentials
      13. Referencing an Assembly
    11. Chapter 3. SharePoint Installation and Configuration
      1. Prepare the Microsoft SharePoint Installation Module
      2. Install SharePoint Unattended
      3. Install Without a Product Key in the Configuration File
      4. Configure a New SharePoint Farm
      5. Join a Server to the SharePoint Farm
      6. Create a New Web Application
      7. Create a New Site Collection
      8. Create a New Subsite
    12. Chapter 4. Farm Management
      1. Review Farm Configuration Values
      2. Set the Farm Configuration Values
      3. Refresh Installed Products
      4. Change the Port of Central Admin
      5. Change the Farm Passphrase
      6. Retrieve the System Accounts
      7. Retrieve Managed Accounts
      8. Rename a Server on the Farm
      9. Display the Configured Managed Paths
      10. Create a New Managed Path
      11. Remove a Managed Path
      12. Merge Log Files
      13. End the Current Log File
      14. Review SharePoint Designer Settings
      15. Configure SharePoint Designer Settings
      16. Review Workflow Configuration Settings
      17. Modify Workflow Configuration Settings
      18. Display Available Timer Jobs on the Farm
      19. Get a Specific Timer Job
      20. Enable a Timer Job
      21. Disable a Timer Job
      22. Start a Timer Job
      23. Set the Schedule for a Timer Job
    13. Chapter 5. Web Application Management
      1. Display Available Web Applications on the Farm
      2. Get a Specific Web Application
      3. Remove a Web Application
      4. Create a New Web Application
      5. Configure Web Application Settings
      6. Extend a Web Application
      7. Create an Alternate Access-Mapping URL
      8. Display All Alternate Access Mappings
      9. Get a Specific Alternate URL Entry
      10. Change the Zone of an Alternate Access Mapping
      11. Remove an Alternate Access Mapping
    14. Chapter 6. Service Application Management
      1. Install Service Applications
      2. Display Available Service Applications on the Farm
      3. Get a Specific Service Application
      4. Configure IIS Settings for a Service Application
      5. Share a Service Application
      6. Remove a Service Application
      7. Display Service Instances on a Server
      8. Get a Specific Service Instance
      9. Start a Service Instance
      10. Stop a Service Instance
      11. Ancillary Cmdlets for Service Applications
    15. Chapter 7. SharePoint Database Management
      1. Display All SharePoint Databases
      2. Get a Specific Database
      3. Create a New Content Database
      4. Display All Content Databases for a Web Application
      5. Detach a Content Database from a Web Application
      6. Attach a Content Database to a Web Application
      7. Delete a Content Database
      8. Create a New Configuration Database
      9. Delete a Configuration Database
      10. Back Up a Configuration Database
      11. Restore a Configuration Database
      12. Back Up the SharePoint Farm
      13. Restore the SharePoint Farm
      14. Back Up a Site Collection
      15. Restore a Site Collection
    16. Chapter 8. Site Management
      1. Display All Available Site Collections on the Farm
      2. Display Available Site Collections in a Web Application
      3. Display Available Site Collections in a Content Database
      4. Get a Specific Site Collection
      5. Remove a Site Collection
      6. Create a Site Collection
      7. Set the Lock State of a Site Collection
      8. Set the Storage Limits on a Site Collection
      9. Create a Site Under a Site Collection
      10. Display All Subsites Within a Site Collection
      11. Get a Specific Subsite (Web)
      12. Remove a Subsite (Web) from a Site Collection
      13. Modify the Subsite (Web) URL
      14. Move a Site Collection to a Different Content Database
      15. Move All Site Collections from One Content Database to Another
      16. Display All Deleted Site Collections
      17. Display Deleted Site Collections in a Content Database
      18. Get a Specific Deleted Site Collection
      19. Remove a Deleted Site Collection
      20. Restore a Deleted Site Collection
      21. Configure Information Rights Management (IRM) Settings
    17. Chapter 9. Solutions and Features
      1. Add a Solution to the SharePoint Farm
      2. Display Available Solutions on the Farm
      3. Get a Specific Solution
      4. Deploy a Solution to a Web Application
      5. Retract a Solution
      6. Upgrade a Deployed Solution
      7. Remove a Solution from the SharePoint Farm
      8. Add a Sandboxed Solution to a Site Collection
      9. Display Available Sandboxed Solutions in a Site Collection
      10. Get a Specific Sandboxed Solution
      11. Activate a Sandboxed Solution
      12. Deactivate a Sandboxed Solution
      13. Upgrade a Deployed Sandboxed Solution
      14. Remove a Sandboxed Solution from a Site Collection
      15. Display Available Features
      16. Get a Specific Feature
      17. Activate a Feature
      18. Deactivate a Feature
      19. Install a Feature in SharePoint
      20. Uninstall a Feature from SharePoint
      21. Export Installed Farm Solutions
    18. Chapter 10. Content Deployment
      1. Create a New Deployment Path
      2. Display Deployment Paths Configured on the Farm
      3. Get a Specific Content Deployment Path
      4. Remove a Content Deployment Path
      5. Create a New Deployment Job
      6. Display Deployment Jobs Configured on the Farm
      7. Get a Specific Content Deployment Job
      8. Remove a Content Deployment Job
      9. Start a Content Deployment Job
      10. Modify Content Deployment Configurations
    19. Chapter 11. User Licensing
      1. Display User Licensing Status
      2. Enable User Licensing Enforcement
      3. Disable User Licensing Enforcement
      4. Display Available User Licenses
      5. Create a New License Mapping
      6. Add a New License Mapping
      7. Display All License Mappings
      8. Remove a License Mapping
    20. Chapter 12. InfoPath Forms Services
      1. Browser-Enabled Form Templates
      2. Throttle Data Connection Timeouts
      3. Throttle the Data Connection Response Size
      4. Modify Authentication Settings
      5. Configure Session State
      6. Enable View State
      7. Verify and Upload a Form Template
      8. Upload Multiple Form Templates at Once
      9. Activate or Deactivate a Form to or from a Site Collection
      10. Remove a Form from InfoPath Form Services
      11. Quiesce a Form from InfoPath Form Services
      12. Enable the Web Service Proxy
      13. Export Forms Services Administration Files
      14. Import Forms Services Administration Files
    21. Chapter 13. Enterprise Search
      1. Display the Enterprise Search Service Information
      2. Display Enterprise Search Service Instances
      3. Get a Specific Enterprise Search Service Instance
      4. Configure the Crawl Account for Enterprise Search
      5. Configure the Enterprise Search Service Performance Level
      6. Display Enterprise Search Service Applications
      7. Get a Specific Enterprise Search Service Application
      8. Create a Custom Metadata Category
      9. Display Available Metadata Categories
      10. Get a Specific Metadata Category
      11. Create a Custom Metadata Crawled Property
      12. Display Available Crawled Properties
      13. Get a Specific Metadata Crawled Property
      14. Create a Custom Metadata-Managed Property
      15. Display Available Managed Properties
      16. Get a Specific Metadata-Managed Property
      17. Create a Metadata Mapping
      18. Use Advanced Cmdlets for Search
    22. Chapter 14. Profile Service
      1. Get the Identity of the Profile Service Application
      2. Get a Specific Profile Service Application Instance
      3. Configure Settings on the Profile Service Application
      4. Remove Old Comments
      5. Remove Old Ratings
      6. Remove Old Tags
      7. Update the Profile Photo Store
      8. Refresh the Feed Cache
      9. Refresh a Specific User’s Feed Cache
      10. Use Advanced Cmdlets for the Profile Service
    23. Chapter 15. Business Data Connectivity Service
      1. Get the Identity of the BCS Service Application
      2. Get a Specific BCS Service Application Instance
      3. Configure the BCS Database
      4. Get a BCS Metadata Object
      5. Import a BCS Model
      6. Export a BCS Model
      7. Set the Entity Notification Web
      8. Get the Entity Notification Web
      9. Create an OData Connection
      10. Get an OData Connection
      11. Update an OData Connection
    24. Chapter 16. Secure Store Service
      1. Get the Identity of the Secure Store Service Application
      2. Get a Specific Secure Store Service Application Instance
      3. Enable Auditing for the Secure Store Service
      4. Configure the Secure Store Database
      5. Generate a New Master Key
      6. Refresh the Encryption Key
      7. Create Application Fields
      8. Create a Target Application
      9. Create a New Application Entry
    25. Chapter 17. Metadata Service
      1. Get the Identity of the Metadata Service Application
      2. Get a Specific Metadata Service Application Instance
      3. Configure the Metadata Service Accounts
      4. Configure the Term Store Database
      5. Configure the Content Type Hub
      6. Get the Identity of the Metadata Service Application Proxy
      7. Get a Specific Metadata Service Application Proxy Instance
      8. Configure the Metadata Service Connection Options
    26. Chapter 18. Session State and State Service
      1. Enable Session State
      2. Disable Session State
      3. Display Session State Information
      4. Configure the Timeout of the Session State
      5. Display State Service Applications Configured on the Farm
      6. Get a Specific State Service Application
      7. Rename a State Service Application
      8. Perform State Service Database Operations
    27. Chapter 19. Work Management Service
      1. Get the Identity of the Work Management Service Application
      2. Get a Specific Work Management Service Application Instance
      3. Configure the Refresh Threshold
      4. Configure the Search Query Threshold
      5. Configure the User Synchronization Per Server
      6. Get the Identity of the Work Management Service Application Proxy
      7. Get a Specific Work Management Service Application Proxy Instance
    28. Chapter 20. Machine Translation Service
      1. Get the Identity of the Machine Translation Service Application
      2. Get a Specific Machine Translation Service Application Instance
      3. Get the Identity of the Machine Translation Service Proxy
      4. Get a Specific Machine Translation Service Application Proxy Instance
      5. Configure the Translation Processes
      6. Configure Translations Throughput
      7. Configure Enabled Document File Extensions for Translation
      8. Modify Database Information
      9. Modify Translation Timeouts
      10. Modify the Maximum Translation Attempts
      11. Modify the Recycle Threshold
    29. Chapter 21. Excel Services
      1. Create a Trusted File Location
      2. Display All Trusted File Locations
      3. Get a Specific Trusted File Location
      4. Remove a Trusted File Location
      5. Create a Trusted Data Connection Library
      6. Display All Trusted Data Connection Libraries
      7. Get a Specific Trusted Data Connection Library
      8. Remove a Trusted Data Connection Library
      9. Create a New Safe Data Provider
      10. Display All Safe Data Providers
      11. Get a Specific Safe Data Provider
      12. Remove a Safe Data Provider
      13. Create a Blocked File Type
      14. Display All Blocked File Types
      15. Get a Specific Blocked File Type
      16. Remove a Blocked File Type
      17. Create a User-Defined Function Reference
      18. Display All User-Defined Function References
      19. Get a Specific User-Defined Function Reference
      20. Remove a User-Defined Function Reference
      21. Modify Excel Services Objects
    30. Chapter 22. PerformancePoint Services
      1. Configure the Unattended Service Account
      2. Display the Unattended Service Account
      3. Create a Trusted Content Location
      4. Create a Trusted Data Source Location
      5. Display All Trusted Content Locations
      6. Display All Trusted DataSource Locations
      7. Display Details of Trusted Locations
      8. Get a Specific Trusted Location
      9. Remove a Trusted Location
      10. Configure PerformancePoint Services to Enforce Trusted Locations
      11. Configure PerformancePoint Services Application Settings
    31. Chapter 23. Access Services
      1. Configure the Application Log Size
      2. Configure the Cache Timeout
      3. Modify the Maximum Columns in a Query
      4. Modify the Maximum Calculated Columns in a Query
      5. Configure the Maximum Order By Clauses
      6. Configure the Maximum Number of Rows in a Query
      7. Configure the Maximum Number of Records in an Access Table
      8. Configure the Maximum Number of Sources in a Query
      9. Enable and Disable the Use of Outer Joins
      10. Allow or Restrict Nonremotable Queries
      11. Throttle Access Services Memory Utilization
      12. Throttle Session Memory Utilization
      13. Configure User Sessions
      14. Limit Template Sizes
      15. Modify Access Services Databases
    32. Chapter 24. Visio Graphics Services
      1. Configure the Unattended Service Account
      2. Create a New Safe Data Provider
      3. Display All Safe Data Providers
      4. Get a Specific Safe Data Provider
      5. Remove a Safe Data Provider
      6. Setting the Description of a Data Provider
      7. Configuring Visio Performance Settings
    33. Chapter 25. Word Automation Services
      1. Configure the Conversion Processes
      2. Configure Conversion Throughput
      3. Configure Supported Document Formats for Conversion
      4. Modify Database Information
      5. Modify Job Monitoring
      6. Modify Conversion Timeouts
      7. Modify the Maximum Conversion Attempts
      8. Modify the Maximum Memory Usage
      9. Disable Word 97–2003 Document Scanning
      10. Disable Embedded Fonts in Conversions
      11. Modify the Recycle Threshold
    34. Chapter 26. Office Web Apps
      1. Create a New WOPI Binding in SharePoint
      2. Review Current SharePoint WOPI Bindings
      3. Configure the Default Action for an Application
      4. Remove WOPI Bindings from SharePoint
      5. Configure the WOPI SharePoint Zone
      6. Disable Certain WOPI Actions
      7. Resolve Invalid Proof Signature
    35. Appendix A. stsadm Versus SharePoint PowerShell
      1. A Operations
      2. B Operations
      3. C Operations
      4. D Operations
      5. E Operations
      6. G Operations
      7. I Operations
      8. L Operations
      9. M Operations
      10. O, P, and Q Operations
      11. R Operations
      12. S Operations
      13. U Operations
      14. V Operations
    36. Appendix B. Upgrade and Migration
      1. Test-SPContentDatabase
      2. Upgrade-SPContentDatabase
      3. Upgrade-SPFarm
      4. Test-SPSite
      5. Repair-SPSite
      6. Upgrade-SPSite
      7. Additional Upgrade Cmdlets
    37. Appendix C. Enterprise Search Reference
      1. Administrative
      2. Crawling
      3. Metadata
      4. Miscellaneous
      5. Querying
      6. Service Application
      7. Topology
    38. Appendix D. App Management Service Reference
      1. App Settings and Configuration
      2. Denied Endpoint Management
      3. Installation and Provisioning of Apps
      4. Marketplace Management
      5. Service Application
    39. Index