Wednesday, November 30, 2011

Attaching Content Database to Web Applications

To attach a content database to a Web application by using Windows PowerShell

  1. Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
  2. On the Start menu, click All Programs.
  3. Click Microsoft SharePoint 2010 Products.
  4. Click SharePoint 2010 Management Shell.
  5. At the Windows PowerShell command prompt, type the following command:
    Mount-SPContentDatabase -Name <DatabaseName> -DatabaseServer <ServerName> -WebApplication <URL> [-Updateuserexperience]
    Where:
    • <DatabaseName> is the name of the database you want to upgrade.
    • <ServerName> is server on which the database is stored.
    • <URL> is the URL for the Web application that will host the sites.
    • Updateuserexperience is the choice to update to the new user experience or stay in the old user experience (part of Visual Upgrade). When you include this parameter, the site is set to preview the new user experience. Omit this parameter if you want the site to remain in the old user experience after upgrade. For more information, see Plan visual upgrade (SharePoint Server 2010).
For more information, see Mount-SPContentDatabase.
noteNote:
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

To attach a content database to a Web application by using the Stsadm command-line tool

  1. On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\14\Bin.
  2. Type the following command, and then press ENTER:

    stsadm -o addcontentdb -url<URL> -databasename<DatabaseName>

    [-databaseserver<ServerName>] [-databaseuser<UserName>]
    [-databasepassword<Password>] [-sitewarning<SiteWarningCount>]
    [-preserveolduserexperiencetrue/false]
    [-sitemax<SiteMaxCount>]
    [-assignnewdatabaseid][-clearchangelog]

Tuesday, November 15, 2011

Create a Web Part Page WITH a Quick Launch Menu in SharePoint 2010


The default web part pages will lose the Quick Launch navigation, so I usually create a blank ASPX page instead. These are the steps to take to create your own web part page. This is also a useful method for creating custom form pages for your lists.
  1. Create a document library to put your web part pages in.
  2. Open your site in SharePoint Designer, and click File –> New –> ASPX
  3. Right Click the page and open in Advanced Mode.
  4. Select Style Menu and choose Attach button on the Ribbon and select Default Master Page., and click Attach Master Page
  5. Click OK for the Default Master Page.
  6. Click the PlaceHolderMain section in the middle of the page, click the little chevron (the little gray button with an arrow on it), and click Create Custom Content.
  7. Put your cursor inside of the PlaceHolderMain section. On the Insert Menu, choose SharePoint Controls, and click Web Part Zone.
  8. Click File and Save As, and save it to the document library that you created at step one.
Now you have a blank web part page that DOES contain the Quick Launch navigation on the left. You can either add web parts here in SharePoint Designer, or from the browser.

Note: If you’d like to have multiple web part zones, step 6 would be to create a table first, and then insert the web part zones into each cell of the table.

 Happy SharePointing!!!

Thursday, November 3, 2011

Create a SharePoint 2010 web part page that inherits the site's left navigation

The SharePoint web part page in SharePoint 2010 does not have a Left Navigation, by default you will have a page that has the top (global) navigation, but no current navigation on the left. This may be exactly what you want, as you will have a bit more space to work with. If you want to show the current navigation on the left hand side of a web part page, here is how to do it:

image

  1. Go to the page that you want to add the left navigation to
  2. Go to Site Actions – and launch “Edit in SharePoint Designer”. This will open the site in SharePoint Designer 2010. You’ll need to navigate to the actual location where the web part page is (usually Site Pages). Open the page you want to edit.
  3. Make a copy by right-clicking on the page, choosing copy, and then choosing paste
  4. Right-click on the (copy of) the page you are going to edit to add the left-nav, and choose Edit File in Advanced Mode
    image
  5. Scroll to (or search for): body s4-leftpanel. Once you find it, you’ll want to comment out the following code:
       1: <%-- <style type="text/css">
       2:  body #s4-leftpanel {
       3:     display:none;
       4: }
       5: .s4-ca {
       6:     margin-left:0px;
       7: }
       8: </style> --%>

  6. Scroll to (or search for): PlaceHolderNavSpacer and comment out the following two lines.
   1: <%-- 
   2: <asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content>
   3: <asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content> 
   4: --%>
Save the page, preview in browser, and voila! Your current navigation is now on the left. If you like the changes, rename your copy to the original filename and you are all set to go!
image 

Happy SharePointing.!!!

Wednesday, November 2, 2011

Update SharePoint 2010 Farm Credentials

Within your SharePoint environment – such as your PowerPivot for SharePoint single server install – a common task that you will need to do is to update the SharePoint Farm credentials when the password changes. You may be able to do this automatically by using the new SharePoint 2010 feature to plan automatic password change.
But if you need to change your farm credentials, you can follow the instructions: How to change service accounts and service account passwords in SharePoint Server 2007 and in Windows SharePoint Services 3.0.
But in the process of updating a PowerPivot for SharePoint single server install, I realized that a few additional tips that may prevent you a few hours of debugging.
  • Since its SharePoint 2010, Step 1a is now the c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Bin folder.
  • The update farm credentials step Step 1b is still (i.e. No change)
stsadm –o updatefarmcredentials –userlogin DOMAIN\username –password $password$
  • Steps 4 and 5 are not required unless you’re running SharePoint Search. In most PowerPivot for SharePoint installations, this service is not running so you don’t need to do these steps
  • Step 6 is not necessary as SharePoint 2010 is using service applications (as opposed to SharePoint 2007 using shared services providers). Though you will want to ensure to update your managed accounts for any services that are using the same account as your farm account.
As well, here are some other good reminders:
  • You should login to your server using the farm account to ensure that you have the rights to run the above commands
  • Make sure that the SQL Server service for your SharePoint databases (for example, the SQLSERVERNAME\POWERPIVOT) is running (from services.msc). Often in PowerPivot for SharePoint installs, the startup account for SQL server and the farm account are the same. If you need to update the password, it is likely that the SQL Server service is not running because the credentials are no longer valid.
  • If you’re still running into issues when running the updatefarmcredentials command, you may want to apply the same step for the SQL Server service to the SharePoint 2010 Timer service.
Hope this helps!

Tuesday, November 1, 2011

How to configure PDF iFilter for SharePoint Server 2010 or Search Server 2010


I recently installed and configured Search Server 2010 Express on my VMware machine for evaluation purposes. Once I configured basic steps to configure Search Centre site and necessary settings, I decided to install PDF iFilter (x64). Last year, I posted a similar article on how to install and configure PDF iFilter for SharePoint 2007 (64bit), which can be found at http://www.mossgurus.com/adnan/Lists/Posts/Post.aspx?ID=9. I didn't find a single decent article on Google, which clearly explain the process of installing and configuring PDF iFilter for SharePoint Server 2010 or Search Server 2010 Express edition. So I decided to follow my own article and I was hoping that it should be straight forward to install and configure PDF iFilter for SharePoint 2010. Apart from updating the registry settings required to update GUID for .pdf, remaining steps are similar.

Follow the steps below to install and configure PDF iFilter on SharePoint Server 2010 or Search Server Express 2010.
  1. Install PDF iFilter 9.0 (64 bit) from here.
  2. Download PDF icon file from pdf16.gif and copy at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\IMAGES\.
  3. Add the following entry in docIcon.xml file, which can be found at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML.
    <Mapping Key="pdf" Value="pdf16.gif" /> 
  4. Add PDF file type on the Manage File Type page under Search Service Application.
  5. Open registry by executing regedit on the Start --> Run.
  6. Navigate to the following location:
    \\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\
    14.0\Search\Setup\ContentIndexCommon\Filters\Extension 
  7. Right-click Extension, a menu will appear.
  8. Click New--> Key to create a new key for .pdf. See screen shot below:
  9. Enter .pdf and save key.
  10. Now add the following GUID in the default value as shown in the figure below.
    {E8978DA6-047F-4E3D-9C78-CDBE46041603} 
  11. If you are configuring SharePoint Server 2010, then restart Search service by executing the following command on the command line:
    net stop osearch 
    net start osearch 
  12. If you are configuring PDF iFilter on Search Server 2010, then restart the SharePoint Server Search 14 service as shown in the figure below:
  13. Perform incremental to include PDF files.
  14. PDF iFilter is successfully configured. Now you can search for the content of PDF file. See screen shot below:
Note: SharePoint Server 2010 or Search Server 2010 Express provides out of the box search support for .ZIP files, so you download and have to install Microsoft Filter pack as you used to do with MOSS 2007.