Stacy Simpkins

Troubleshooting SharePoint

The Complete Guide to Tools, Best Practices, PowerShell One-Liners, and Scripts

Stacy Simpkins

Brandon, Florida, USA

Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/9781484231371 . For more detailed information, please visit http://www.apress.com/source-code .

ISBN 978-1-4842-3137-1

e-ISBN 978-1-4842-3138-8

https://doi.org/10.1007/978-1-4842-3138-8

Library of Congress Control Number: 2017960834

© Stacy Simpkins 2017

This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.

Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.

While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.

Printed on acid-free paper

Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

This book is dedicated to Saanvi, Owen, Willow, Oaklyn, and Weston.

Introduction

This introduction covers, at a high level, the topics that this book discusses. The book assumes that you already have a development SharePoint environment that you can use to perform the exercises. If you don’t have a development farm and are not sure about the steps needed to create one, you should get a copy of my book Building a SharePoint 2016 Home Lab: A How-To Reference on Simulating a Realistic SharePoint Testing Environment (Apress, 2016). Although it is possible to read each chapter independently, there are parts of chapters that build off previous chapters and/or assume some requisite SharePoint knowledge. The following is the 40,000-foot view.

Chapter 1 . Least-Privileged SharePoint Builds

This chapter thoroughly discusses building a SharePoint farm using least privileging. It starts to peel away the troubleshooting onion, layer by layer, and explains why a least-privileged build is important for troubleshooting.

Chapter 2 . Key Settings of a Good Build

This chapter is the first of two parts that cover the key settings of a good build. You’ll learn about SQL aliases, MSDTC, to IIS WAMREG and DCOM, Network Service, and the local security needs of a farm account.

Chapter 3 . More Key Settings of a Good Build

This chapter finishes the discussion on key settings in the file system as they relate to App Fabric and Distributed Cache, User Profile Synchronization, publishing infrastructure, account management, logging locations and levels, and path-based vs. host headers, also known as host named site collections.

Chapter 4 . Files, Virtual Mappings, and IIS Settings

This chapter explores the changes that SharePoint makes to a Windows server file system and discusses how this relates to IIS. It looks at IIS logging and opens the discussion that surrounds the connection between IIS logs, SharePoint logs, and Windows logs.

Chapter 5 . Database and Security Operations

This chapter opens SQL Server Management Studio and looks at the SQL Server settings, database settings, server roles, database mappings, SQL logging, and various PowerShell and/or command-line operations as they relate to SharePoint database security operations from within SSMS and/or SQL Server configuration.

Chapter 6 . SQL Backup and Restore, and Useful CLI

This chapter covers a few more SQL-related topics, such SQL database backup and restore options, unattached restores, SQL file restores, and PowerShell site collection backup and restore. We look at some Windows OS commands that yield helpful troubleshooting information, including systeminfo, ncpa.cpl, msinfo32, SC, and others as I talk about finding answers to troubleshooting questions.

Chapter 7 . Search Configuration and Troubleshooting

This chapter peels back a deeper layer of the troubleshooting onion as it relates to issues with search, search configuration with PowerShell, and the search service application. We look at some cool scripts and take a fairly good dive into search.

Chapter 8 . Troubleshooting Services

This chapter looks at troubleshooting User Profile Synchronization Connections, Excel Services, Office Web app connections, and patching Office Web apps. We look at managed metadata term stores and discuss the connection to the User Profile Service. I’ll discuss web.config modifications and using PowerShell to determine if the web.config is modified. Along with looking at web.config, PowerShell interrogates timer jobs, log levels, and databases. Finally, PowerShell is used to unprovision and provision services.

Chapter 9 . Tools: ULS, merge-splogfile, and Other PowerShell cmdlets

This chapter’s primary focus centers on ULS logs, ULS viewer, merge-splogfile, and other PowerShell cmdlets that pertain to Windows logs. It discusses the numerous settings of ULS viewer and some various scenarios and methods. The chapter explains the connection between SharePoint and Windows event logs and helps the reader understand how to decipher what the logs are saying and how to use the logging system and configure it.

Chapter 10 . Tools: Network Packet Tools and Page Performance

This chapter discusses the use of ProcMon, WireShark, Fiddler, NetMon, developer dashboard, and more! It also covers a few more tools used to look at network packets, IIS logs, and page load performance.

Chapter 11 . Tools: SharePoint Health Analyzer Demystified

This chapter discusses the SharePoint Health Analyzer report, the Performance Analysis of Logs (PAL) tool for SharePoint, the SharePoint Manager tool, the SharePoint feature admin tool, and finally, a summation of the three chapters on troubleshooting tools.

Commonly Used Shortcuts

In this book, we use keyboard shortcuts, the run bar, and commands quite a bit. Table- A lists some of the commands with a brief description.

Table-A. Keyboard Shortcuts and Commands Used in This Book

CommandKeyboard Shortcut

Description of Run Command

Windows key + R

Opens the run bar

Cmd

Opens the Command window

Comexp

Opens the Component Services manager

Compmgmt.msc

Opens the Computer Management console

ipconfig

Opens the ipconfig information

nslookup

Opens a command-line interface to DNS

Ncpa.cpl

Opens the network connections

Regedit

Opens the registry editor

Control netconnections

Opens the network connections

Msinfo32

Opens the system information

Sysdm.cpl

Opens the system properties

Services.msc

Opens the Services console

Dsa.msc

Opens the Active Directory users and computers

Dnsmgmt.msc

Opens the Domain Name System manager

Gpmc.msc

Opens the Group Policy Manager

Control Panel

Open the control panel

Lusrmgr.msc

Open the Local Users and Groups administration console

Notepad

Opens Notepad

Adsiedit.msc

Opens the Active Directory Service Interface editor

Summary

The goal of this book is to provide you with a much broader troubleshooting arsenal for SharePoint and perhaps a deeper understanding of how the file system relates to the databases. We do not delve into unsupported activities, such as table modifications, as that would not be in best practice; however, there are a couple points in the book where we come close, as we look into certain tables inside the SharePoint SQL Server database tables. No animals were hurt during the making of this book and all of the tools you see used in this book are available free of charge and are downloadable on the Internet.

Acknowledgments

I’d like to thank my fellow Rackspace SharePoint engineers for their contributions: Scott Fawley, J. T. Shoupe, Stephen Swinney, Danny Pugh, Mike Ross, Mike Clarke, Jarod Oliver, Daocheng Li (Richard), Mark Watts, Ryan Holderread, Brad Slagle, and Tray Harrison. Originally, I had planned to provide a short bio of everyone on this list; however, we weren’t able to pull them all together before printing. To everyone on this list, I sincerely thank you for your fanatical support and the awesome SharePoint knowledge, and the wisdom you’ve shared with me over the last year.

Contents

  1. Chapter 1:​ Least-Privileged SharePoint Builds
    1. Why Least Privilege
      1. An Ounce of Prevention Is Worth a Pound of Cure
      2. Local Group Membership
      3. Ask the Domain Controllers
      4. Database Permissions for Farm Account Vs Install Account
      5. File System Permissions for Members of the WSS_​Admin_​WPG Local Group
      6. Logging File Paths
      7. Registry Permissions
      8. Application Pool Accounts
      9. WSS_​WPG Registry Access
      10. Application Pool Accounts in IIS
      11. PowerShell to Reset Local Permissions and Files
      12. Inspecting for Least Privilege
    2. Next Steps
  2. Chapter 2:​ Key Settings of a Good Build
    1. PowerShell Aliases
    2. Verb-Noun
    3. All PowerShell cmdlets Are Objects
    4. Running Administratively​ and the SharePoint Management Console
    5. Variable Instantiation
    6. Objects as a Form of Troubleshooting
    7. Avoiding Scrolling Truncation
    8. Enumerating Sites
      1. Step 1
      2. Step 2
    9. PowerShell Script to Create Central Administration
    10. PowerShell Script to Create Service Applications
    11. Building a Farm with AutoSPInstaller
    12. MSDTC and DCOM Settings
    13. Network Service Permissions
    14. Local Security for the Farm Account
    15. Next Steps
  3. Chapter 3:​ More Key Settings to a Good Build
    1. COM+ Security for User Profile Sync
      1. App Fabric and Distributed Cache
    2. User Profile Synchronization
    3. Patching
    4. Publishing Infrastructure vs.​ Minimal Download Strategy
    5. Account Management
    6. Logging Locations and Levels
    7. Path-based vs.​ Host-named Site collections
    8. HNSC or HHSC
    9. Next Steps
  4. Chapter 4:​ Files, Virtual Mappings, and IIS Settings
    1. Got Weird Stuff?​
    2. SharePoint IIS Site Directories
    3. Virtually Mapped Folders
    4. SharePoint Web Services
    5. What About Registry?​
  5. Chapter 5:​ SQL
    1. PowerShell
    2. Configuring SharePoint-Integrated Reporting with SQL Server 2012/​2014
      1. Scenario 1
      2. Scenario 2
  6. Chapter 6:​ SQL Backup and Restore and Useful CLI Commands
    1. Event ID 5586
  7. Chapter 7:​ Search Configuration and Troubleshooting
  8. Chapter 8:​ Service Application Troubleshooting
  9. Chapter 9:​ ULS Viewer
  10. Chapter 10:​ Tools:​ Network Packet Tools and Page Performance
    1. Wireshark
    2. Fiddler
    3. NetMon and Message Analyzer
    4. Developer Dashboard
    5. Webalizer
    6. Indihiang
    7. SPS Farm Report utility
    8. Process Monitor (ProcMon)
  11. Chapter 11:​ Tools:​ SharePoint Health Analyzer Demystified
    1. SharePoint Health Analyzer Tool
    2. Performance Analysis of Logs (PAL) Tool for SharePoint
    3. SharePoint Feature Administration and Cleanup Tool
    4. The SharePoint Manager Tool
    5. Wrap Up
  12. Index

About the Author and About the Technical Reviewer

About the Author

A449972_1_En_BookFrontmatter_Figb_HTML.jpg

Stacy Simpkins is a SharePoint engineer with Rackspace, the number-one managed cloud company. He is passionate about SharePoint and loves helping customers understand and get the most out of SharePoint. Prior to Rackspace, Stacy worked with the federal government as an IT specialist and across multiple industries (food, legal, manufacturing, health insurance, and professional services) architecting and developing small, medium, and large SharePoint environments as a consultant. As a consultant, he served as a solutions architect for Magenium Solutions and as a senior consultant for Sogeti LLC. Stacy holds numerous Microsoft Certifications. During his limited free time, he enjoys blogging about SharePoint and other Microsoft products, speaking at user group meetings, and leading the Tampa Bay SharePoint user group.

About the Technical Reviewer

A449972_1_En_BookFrontmatter_Figc_HTML.jpg

Samarjeet Singh Tomar is a SharePoint Engineer for the Blue Cross Blue Shield Association (BCBSA), a national federation of 36 independent, community-based and locally operated Blue Cross and Blue Shield companies. He is passionate about SharePoint and .Net Core, Tableau, Angular, D3, Power-BI and helping customers and business in automate and visualization. Prior to BCBSA, Samar worked with various industry domains and service area. He is passionate about learning and implementing different technology and build scalable solution using proven practices. During his limited free time, he enjoys blogging about SharePoint and other technologies, he loves travelling and playing computer games.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.171.121