Chad's Eclectic Tips and Tricks

Tips some days, not everyday, mostly Windows & SharePoint from Chad Schultz - Premier Field Engineer

November, 2009

  • Tip 9: Adding Accounts to a Site

    This tip is for Windows SharePoint Services 2.0/3.0, SharePoint Portal Server 2003, Microsoft Office SharePoint Server 2007, SharePoint Foundation 2010 and SharePoint Server 2010.

    The reason I didn’t say in the title of this post “Adding Users to a Site” is that the best practice is not to add user accounts into the SharePoint groups. Rather add Active Directory groups to the SharePoint groups to keep the number of security principals per group down. There is a limit to how many security principals can be added to a SharePoint group. See Plan Site Security for more information.

  • Tip 8: What Is a Configuration Cache and Why Do I Care About It?

    This tip is for Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 and may apply to SharePoint Foundation 2010 and SharePoint Server 2010.

    Many times when troubleshooting an issue with Microsoft the engineer will have a customer “Clear the Config Cache”, so what does this mean and how invasive is this process?

    The cache goes by many names; file system cache, configuration cache, object cache, bunch of XML files and on and on. What this cache really is though is a cache of the farm configuration database objects. Since most things in SharePoint are objects and all SharePoint servers in a farm need to know information on these objects, it makes sense to cache this information locally on each server to save on database round trips. But like any cache this information can become stale or incorrect for many reasons. Usually this is caused by a change made on 1 SharePoint server in the farm not being written to the configuration database, either because of SQL timeouts, the SQL stored procedure did not complete, the SharePoint server is at a different version level than the rest of the farm, the list goes on.

    Therefore clearing the cache is sometimes needed to get all of the SharePoint servers up to date on the latest farm information. This involves shutting down the SharePoint Timer service on all of the machines and deleting all of the XML files in the %ALLUSERSPROFILE%\Microsoft\SharePoint\Config\<GUID>. Opening the cache.ini file in Notepad.exe and changing whatever value is present to 1; then starting the SharePoint Timer service again on each server in the farm. During this process no timer jobs will be ran obviously, but the sites that SharePoint is hosting will be available barring any major catastrophic problem.

    There is a timer job called Config Refresh on ever SharePoint farm which runs every 15 seconds and updates the cache on all of the SharePoint servers in the farm. When the XML file for an object does not exist on a server a new XML file is created with the current information from the SharePoint’s farm configuration database.

    So long story short; clearing the cache is sometimes needed when there may be inaccurate information in a SharePoint server’s persisted object cache and clearing this cache is most likely safe to perform at any time.

  • Tip 7: Set Diagnostic Logging Back to Defaults

    This tip is for Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 and may apply to SharePoint Foundation 2010 and SharePoint Server 2010.

    One great way to troubleshoot any SharePoint issue is to set the SharePoint diagnostics logging to “Verbose” for the category which fits with the technology that having an issue. There is an “All” category, but that is usually too much information, so it's best to set logging on different categories. After troubleshooting has been completed how can you get back to the normal logging setting so the logging not impacting performance or logging too much noise? Here is the Stsadm.exe command to set the logging levels back to defaults.

    Stsadm.exe -o setlogginglevel -default

    There you go, back to normal.

    Note that this is farm-wide, so just run once on any SharePoint server in the farm. Note that this will not set the location or the number of log files or minutes to log in each file, we’ll leave that for another tip. :)

  • Tip 6: Browsing to a Document Library

    This tip is for Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 and may apply to SharePoint Foundation 2010 and SharePoint Server 2010.

    Did you know you can browse to documents in a SharePoint document library without going to the web site?

    To open a document in Windows Explorer you can use 2 formats; HTTP URL and UNC.

    To browse to a document library using HTTP; open My Computer or My Network Places and type the location of the document library in the following format: http://AddressOfSite/DocumentLibrary.

    To browse to a document library using UNC; open “My Computer”, “My Network Places”, “Network” or any Explorer window and type the location of the document library in the following format: \\AddressOfSite\DocumentLibrary. If using UNC path, make sure that the WebClient Windows service is set to Manual or Automatic and start the service. On Windows XP and greater this can be done with the following commands:

    sc config WebClient start= demand. *Note that there is a space after “start=”.

    sc start WebClient

    If using the UNC path you can also map a drive to the location using the NET USE command like so:

    net use z: \\AddressOfSite\DocumentLibrary

    There you go, now you can get to your documents lickety-split.
  • Tip 5: Use a SQL Connection Alias

    This tip is for Windows SharePoint Services 2.0/3.0, SharePoint Portal Server 2003, Microsoft Office SharePoint Server 2007, SharePoint Foundation 2010 and SharePoint Server 2010.

    This tip can save some headaches when making changes to your SQL configuration for SharePoint. Take some time before running the SharePoint products and Technologies Configuration Wizard and creating a new farm. Creating a SQL alias will mean that you will be able to switch SQL servers on the back end without having to reconfigure SharePoint. To create a SQL connection alias simply run cliconfg.exe on each SharePoint server that will be joined to the far, click the Alias tab and click Add. Enter the Alias name, Network Library/Protocol and Connection Parameters.

    Now when running the SharePoint products and Technologies Configuration Wizard specify the alias name instead of the database server\instance when entering the database information. When the farm creation is complete, the Central Administration Servers in Farm page will show the SQL alias instead of the actual SQL server and instance name. For any new SharePoint servers being added to the farm, run the cliconfg.exe and create the same SQL alias on the server before adding it to the farm. Now you will be able to change out your SharePoint farm's entire SQL back end just by moving the databases to another server and updating the SQL alias of each SharePoint servers in the farm.
  • Tip 4: No Mouse, No Problem

    This tip is for Windows SharePoint Services 2.0/3.0, SharePoint Portal Server 2003, Microsoft Office SharePoint Server 2007 and may apply to SharePoint Foundation 2010 and SharePoint Server 2010.

    Okay, enough of the upgrade tips. Today we’ll take a break and do a small tip on navigating a SharePoint web site.

    Need to drop down the list of actions on a list item or document, but your mouse died? Use the Tab key to move your selection to the title of the list item or document and then hit Shift-Enter to bring up the item menu. Use the arrows and then hit Enter to complete the action.
  • Tip 3: Better Upgrade Troubleshooting

    This tip is for Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 and may apply to SharePoint Foundation 2010 and SharePoint Server 2010.

    When the SharePoint Technologies Configuration Wizard does not finish successfully, the wizard will direct you to look at the following file, C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS\PSCDiagnostics_DATE_TIME_CODE.log. This file does contain information on the failure, but a better file to check is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\LOGS\Upgrade.log. Open the file in Notepad and do a find for the text, [ERROR]. The error message you find in the Upgrade.log will be much better help than the PSCDiagnostics log for tracking down the failure issue.
  • Tip 2: Updating Big Content Farms

    This tip is for Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 and may apply to SharePoint Foundation 2010 and SharePoint Server 2010.

    If your SharePoint farm has a large amount of content then detaching the content databases from the web applications before running the SharePoint Products and Technologies Configuration Wizard on the first server in the farm will speed up the installation and upgrade wizard. Of course you will still have to reconnect the databases afterward, but if you are doing the upgrade after hours at least you can get through the manual part of the install and monitor the attach process.

    *One caveat, when you detach a content database, the next crawl of the site collections in that database will be full even if they are scheduled as incremental.
  • Tip 1: The right way to upgrade to a SharePoint Service Pack or Update

    This tip is for Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007.

    First step test the update in a test farm. Second, test again. Third, make backups (Database and file system). Okay, now you can start with the upgrade.

    Install the Windows SharePoint Services update/Service Pack on all servers in the farm. Install the Microsoft Office SharePoint Server update/Service Pack on all servers in the farm if applicable.

    Run the SharePoint Products and Technologies Configuration Wizard on each server in the farm. A good start would be the server running the Central Administration service. Alternatively, you can run psconfig.exe -cmd upgrade –inplace b2b to accomplish this. Some upgrade errors can be fixed by running the psconfig.exe command with the psconfig.exe -cmd upgrade –inplace b2b -force switch also.

    Only after all of the updates and wizards have run successfully, is the farm upgraded to the new version. A good way to test this is to run stsadm.exe -o localupgradestatus on the servers in the farm. If it shows OK, the upgrade was successful on that server.
  • Introducing SharePoint Tip of the Day

    In the spirit of Sara Ford's Visual Studio 2008 Tip of the Day (http://blogs.msdn.com/saraford/archive/2007/07/21/introducing-visual-studio-2008-tip-of-the-day.aspx); I am going to attempt to put out a SharePoint Tip of the Day. I will not be version specific, so tips can be from SharePoint 2001/SharePoint Team Services all the way to SharePoint 2010.

    One tip per day, no weekends, or holidays(US) ;).

    First goal is to get 1 week of tips, then I’ll make a goal of 1 month and then before you know it, the ball should be rolling. It’s like exercising, easy to start but tougher to keep going. First post coming on Monday. Second post hopefully coming Tuesday. ;)