Tuesday, January 31, 2012

Install and Configure Office Web Apps for SharePoint 2010

Introduction:
Office Web Apps is introduced for the benefit of remote users who don't have Microsoft Office installed in their machines. This implementation guide walks through step by step on: Installing and Configuring Office Web Apps in SharePoint 2010.

Steps Overview

To install office web apps in SharePoint 2010, it takes these three steps:
  1. Install  Office Web apps binaries & run products and technologies configuration wizard
  2. Start the Office web apps services & create service applications
  3. Activate the Office web apps in site collections
Important
  • When installing on a SharePoint farm (not a standalone installation), you will need to install Office Web Apps on every server. You can load balance and install Office Web Apps on multiple servers to optimize performance.
  • Service accounts you use need to have read/write access to the SharePoint Configuration database and all content databases that house the site collections where Office Web Apps was activated

Install Office Web Apps


Download and start Office Web apps installation by running setup.exe. Provide the product key on Enter Your Product Key page, and click Continue.
install office web apps SharePoint 2010
Check the box next to I Accept the Terms of This Agreement and click "Continue"
sharepoint 2010 office web apps product key
Choose the file location and click on “Install Now” button
install office web applications sharepoint 2010
Wait for the installation to complete
install office web apps in sharepoint 2010 server
Run Products & Technologies configuration wizard
Upon successful installation, we will be presented with “Run Configuration Wizard” window. Leave the check box ticked, next to Run the SharePoint Products Configuration wizard and click “Close”.
If you didn’t tick the check box, and closed the wizard by mistake: Launch the Product and Technologies Configuration wizard from Start >> Programs  >> Microsoft SharePoint 2010 Products  >> SharePoint 2010 Products Configuration Wizard and let it run.

Click “Next” on the Welcome to SharePoint Products window
Click Next and click Yes to acknowledge the restart of IIS, SharePoint Administration and Timer Services.
office web apps sharepoint 2010 installation 
Click Next
install office web apps in sharepoint 2010
Click Next
install office web applications in sharepoint 2010
Click Finish to complete the successful office web apps installation
how to install office web applications sharepoint 2010 

2. Start the Office web apps services & create Service Applications

The next step is: starting the required Office Web Apps services from Central Administration >> System Settings >> Manage services on server.
Start these Services:
  • Excel Calculation Services
  • PowerPoint Service
  • Word Viewing Service
sharepoint 2010 office web apps services

Creating Service Applications

Let’s create service applications for office web application by navigate to Central Administration à Application Management à Manage service applications.
sharepoint 2010 office web apps service application
Click on New >> PowerPoint Service Application
sharepoint 2010 office web apps create service application
Enter the following details to complete the creation of the PowerPoint  Service Application.  Make sure you select “Add Application Proxy to Default group” check box.
sharepoint 2010 office web apps service application
Make sure the service application pool account has db_owner access rights on the content databases. Click OK
Now, We have the PowerPoint service application ready.  Repeat this step for other service applications: “Word Viewing Service” and “Excel Services Application”

Activate the Office Web Apps

We must activate Office Web Apps on each site collection based on our requirement. PowerShell can be utilized to activate Office web apps on multiple site collections at once!
$webAppsFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OfficeWebApps"}).Id

Get-SPSite –limit ALL | foreach  {
enable-SPFeature $webAppsFeatureId –url $_.URL }

Browse to the site collection, click on Site Actions à Site Settings.
Under Site Collection Administration, click on Site Collection Features.
sharepoint office web apps activate
Navigate down the page until you find Office Web Apps and click on Activate.
sharepoint office web apps activate
You should now be able to open a Microsoft Word document from a document library on your SharePoint site and it should launch within the browser by default.
By default, Office Web Apps makes documents to open in browser!

Unit Test:

You should now be able to open any Microsoft office document, Excel Sheets, PowerPoint Presentations from SharePoint document library by just clicking on View in Browser, Open in Browser ECB Menu items.
If you see View or Edit in Browser as menu item, your Office Web Apps is configured correctly.
This should render the document in the browser and enable the end user to edit.
    office web apps sharepoint 2010 document
In SharePoint 2013, Office Web Apps is no longer a service application that is part of your SharePoint farm. Instead it is installed as a separate farm.


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Search Error 10032: Could not create a database session. Context: Application {GUID} Details: The database connection string is not available

SharePoint 2007 Search on a specific WFE returned "Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information." while in other WFEs search worked perfectly. This happened after I stopped the search service on a specific server and started it on another server in the Farm.
Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.
Examined the event logs and found the error:
Could not create a database session. Context: Application {GUID} Details: The database connection string is not available
Search Error 10032: Could not create a database session

 Fix:
 Exported the registry key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Applications\{GUID}] from the WFE where search works, and imported to the problematic server.

Which was something like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\Search\Applications\19d466e6-f04b-40b5-b9fa-525791e7fb50\ResourceManager]
"Data"="Server=SQLServerName;Database=SharedServices1_Search_DB;Trusted_Connection=yes;App=Windows SharePoint Services;Timeout=15"
"Search"="Server=SQLServerName;Database=SharedServices1_DB;Trusted_Connection=yes;App=Windows SharePoint Services;Timeout=15"

and it worked like a charm!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


SharePoint Web Services - Test Mode

Do you know SharePoint web services has Test mode?
test web services using browser

To Enable "Test mode", Edit the web.config file on:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\isapi

Place the Highlighted code in the file:
test web services browser


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, January 29, 2012

PSConfig Wizard Configuration Failed: An Update Conflict has occurred, and you must re-try this action. An exception of type Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException was thrown

During Service pack 3 patching on MOSS 2007, SharePoint Products and Technologies Configuration Wizard ended with Error: Configuration Failed
"An exception of type Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException was thrown", An Update Conflict has occurred, and you must re-try this action.
PSConfig Wizard Configuration Failed: An Update Conflict has occurred. An exception of type Microsoft.SharePoint.Administration.SPUpdatedConcurrencyException was thrown
Checked the Update Log file:
There is a log event with "An update conflict has occurred, and you must re-try this action. The object SPFarm Name=<Config-DB-Name> is being updated by <Farm-Admin-Account>, in the STSADM process, on machine <Server-Name>.  View the tracing log for more information about the conflict."
An Update Conflict has occurred, and you must re-try this action

Solution:
Clear config Cache as per Microsoft KB: http://support.microsoft.com/kb/939308/ ,Restart Timer service and run the PSconfig wizard again!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


SharePoint Configuration wizard stuck and never ending when applying service pack. "SyncUpgradeTimerJob: sleeping for 10 seconds" in Upgrade.log

I was doing a SharePoint 2007 SP3 upgrade, After installing the binaries, I ran SharePoint Products and Technologies Configuration Wizard.

The wizard runs through and then gets stuck on "Performing configuration task 8 of 9". It hung for 8 hours! I looked in the upgrade.log, The log was full of thousands of “SyncUpgradeTimerJob: sleeping for 10 seconds” messages.
SharePoint Configuration wizard stuck "SyncUpgradeTimerJob: sleeping for 10 seconds" in Upgrade.log

Here is what I did to fix:
  • Killed the wizard first!
  • Stopped and set the start up type as manual for these services in services.msc console.
  1.      World wide web service
  2.      Microsoft Single Sign-on Service
  3.     Windows SharePoint Services Search

  • Restarted "SharePoint SharePoint Services Timer" and "Windows SharePoint services Administration" Services
  • Then tried upgrading from the command line
          psconfig.exe -cmd upgrade -inplace b2b -force

command executed in 30 min and upgraded successfully! Refer this link to Troubleshoot common Errors during patching: http://support.microsoft.com/kb/944267

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, January 25, 2012

Do not delete Files in "C:\Windows\installer" On SharePoint Servers

Never delete the Install cache folder %windir%\installer to free up some disk space. This will cause serious problems during service pack upgrades! 

In one of my case, It happened. Installer folder was deleted and when I tried installing the Service pack 2 , It scolded me with this error:
"The detection failed, this can be due to a corrupted installation database."
The detection failed, this can be due to a corrupted installation database
Workaround is: I copied the files inside Installer cache from other SharePoint server and ran the upgrade again. It worked!

Update:
Found these articles to collect the Install cache from other servers and update the failed server:
http://moss2007.kbnk.info/Patching/solved-the-detection-failed-this-can-be-due-to-a-corrupted-installation-database.html

http://social.technet.microsoft.com/Forums/en/sharepointadmin/thread/cfa66cd3-2aa2-44ee-9393-ffae41d4f70c

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, January 23, 2012

The secure sockets layer (SSL) certificate sent by the server was invalid and this item will not be crawled - SharePoint Search Error

When starting the full crawl of the default content which includes HTTPS sites, I received the error:
"The secure sockets layer (SSL) certificate sent by the server was invalid and this item will not be crawled."
The secure sockets layer (SSL) certificate sent by the server was invalid and this item will not be crawled
Its because one of the site was SSL enabled and Index server is not configured to Trust the site.

Solution:
Go to "Central Administration > Application Management > Manage Search Service > and click on
Farm Level Search Settings.

Scroll to the bottom of the page, under the SSL Certificate Warning Configuration section, select the "Ignore SSL certificate name warnings" and click OK.

Same can be done by clicking "Proxy and timeouts" link in Search Administration of SSP.

Technet article:
http://technet.microsoft.com/en-us/library/cc262907%28office.12%29.aspx

For SharePoint 2010: http://technet.microsoft.com/en-us/library/ee792873.aspx

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, January 22, 2012

Call web service from Nintex Workflow - To Copy List item between Site Collections

Requirement: Copy a List item between site collections.

Oops! Nintex doesn't has any direct method to do that. It offers Copy/Move/Create list items with in Same site, but not between site collections. So, Lets seek help from Web services with Nintex.

Lets say, I've a Source-list and Target-List. What I want is: based on some conditions, copy the item from source list to target list. Here is the Nintex's part.
  1. Drop a Call web service action in Nintex workflow
Nintex Call Web Service Action
             2. Get the web services from the target site, e.g: http://SharePoint-Site.com/_vti_bin/Lists.asmx, and then configure the action as per the below picture
Call web service from Nintex To Copy List item between Site Collections


    So, Look at the highlighted sections. Here you have to specify the GUID of the target list and supply the XML data for values.

 <Batch OnError="Continue">
     <Method ID="1" Cmd="New">
              <Field Name="Title"> {ItemProperty:Title} </Field>
               <Field Name="Salary"> {ItemProperty:Salary}</Field>
     </Method>
 </Batch>    


Here, the {ItemProperty:Title} and {ItemProperty:Salary} are fields inserted using Nintex "Insert Reference" button!

For the Update operation, we can use the same method, only  the CMD changes from NEW to UPDATE.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
          <listName>my-List</listName>
            <updates>
              <Batch OnError="continue" PreCalc="TRUE" ListVersion="0"> 
              <Method ID="1" Cmd="Update"> 
                <Field Name="ID">{ItemProperty:ParentID}</Field> 
               <Field Name="ApprovedinTargetList">No</Field> 
            </Method> 
        </Batch>
   </updates>
        </UpdateListItems>
    </soap:Body>
</soap:Envelope>

The Most important part here is: ID field, which maps our update operation with the particular list item. And XML is case sensitive, e.g. "id" will not work, but "ID" will work!


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, January 21, 2012

The expected version of the product was not found on the system - Error when trying to Install SharePoint Service pack

Usually, This error occurs when we miss some in-between updates. e.g. I Installed MOSS 2007 SP1 + Language Pack SP1, then Installed MOSS 2007 SP2 without Language pack and when I tried installing Oct-2009 CU, I got this error.
The expected version of the product was not found on the system - Error when trying to Install SharePoint Service pack

Apparently we need to download and Install both the WSS and MOSS updates along with their language packs separately.

Once I installed SP2 for the WSS and MOSS Language Packs, the update installed just fine.

What if none of the above works?
In case, If you installed all the updates along with their language packs, and still getting this error, then you can by-pass the version check by providing "PACKAGE.BYPASS.DETECTION.CHECK=1" parameter to the installer.

e.g. run the installer from command line as:
"wssv3lpsp2-kb953338-x64-fullfile-en-us.exe PACKAGE.BYPASS.DETECTION.CHECK=1"

You can download the MOSS 2007 service packs from:
http://technet.microsoft.com/en-us/office/sharepointserver/bb735839.aspx

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, January 20, 2012

Open with Windows Explorer Error: "Your client does not support opening this list with windows explorer"

Some of the end users got the following message when trying to open a SharePoint Document Library in explorer view from Windows 7 / Windows Server 2008.
Open with Windows Explorer Error

Error : "Your client does not support opening this list with windows explorer"
Open with Windows Explorer Error: "Your client does not support opening this list with windows explorer"

Try these solutions:
Still facing the trouble? Use the Alternate to Open with Explorer


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


How to send E-Mail using SPUtility.SendEmail

SharePoint SPUtility class has SendEmail method which is used to send email to any email address. By default, SPUtility.SendEmail() method picks the 'From address' from Outgoing E-Mail Settings in Central administration. Use SPUtility.IsEmailServerSet method to check if server is configured with SMTP mail settings.

Here is a C# Example for sending E-mail using SPUtility.SendEmail:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using System.IO;
using Microsoft.SharePoint.Utilities;
using System.Collections.Specialized;

namespace HideUserInfo
{
    class SendEMail
    {
        static void Main(string[] args)
        {

            using (SPSite oSPSite = new SPSite("https://sharepoint.com"))  //Site collection URL
            {
                using (SPWeb oSPWeb = oSPSite.OpenWeb("News"))  //Subsite URL
                {
                    StringDictionary headers = new StringDictionary();

                    headers.Add("from", "sender@domain.com");
                    headers.Add("to", "receiver@domain.com");
                    headers..add("bcc","SharePointAdmin@domain.com");
                    headers.Add("subject", "Welcome to the SharePoint");
                    headers.Add("fAppendHtmlTag","True"); //To enable HTML format

                    System.Text.StringBuilder strMessage = new System.Text.StringBuilder();
                    strMessage.Append("Message from CEO:");
                   
                    strMessage.Append("<span style='color:red;'> Make sure you have completed the survey! </span>");
                    SPUtility.SendEmail(oSPWeb, headers, strMessage.ToString());

                }
            }
        }
    }
}

How to use SPUtility.SendEmail in PowerShell:
$site = New-Object Microsoft.SharePoint.SpSite("http://sharepoint.company.com")

#We can use: Get-SPWeb in SharePoint 2010 
$web = $site.OpenWeb()

$mail = [Microsoft.Sharepoint.Utilities.SpUtility]::SendEmail($web,0,0,"support@company.com","Subject of the Mail","mail body")
SPUtility.SendEmail method MSDN Link

SPUtility sendemail method has some limitations like:
  • No support for attachments
  • Message body should not exceed 2048 characters.
To overcome the limits, use the System.Net.Mail class methods as explained in my another Send E-mail Programmatically in C#. To retrieve Outbound SMTP Server Use new MailAddress(WebApplication.OutboundMailSenderAddress, fromName);

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Windows SharePoint Services Web Application - Stuck at "Starting" Status

I had this trouble after applying Service pack 3 on an existing MOSS 2007 environment: Windows SharePoint Services Web Application stuck at "Starting" status and yet it never starts!
windows sharepoint services web application stuck at stopping status
Solution: Stsadm command to stop windows SharePoint services web application stuck on stopping
  1. Jump started to STSADM to stop the service: stsadm -o provisionservice -action stop -servicetype SPWebService
  2. Did IISReset
  3. After that I could start it either from command line or from central admin. stsadm -o provisionservice -action start -servicetype SPWebService
Please note: Stopping the Windows SharePoint Services Web Application will remove the virtual directories in IIS, reverts the web.config changes, etc.

So, we have to apply the customizations once it started again.

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, January 19, 2012

404 Page Not found on Checked Out Files

An end-user sent a mail along with SharePoint Document's URL to another user. When receiver tried accessing the document, it resulted "404 Page not found" to him. However the sender is able to access the document successfully!

When I tried with Farm Admin access, even I got "404 Page not found", after an hour of going crazy, found the document was checked out by the sender!
404 Page Not found Error on Checked Out Files


Get into the Document Library settings, Manage Checked out files, and then took the ownership of the file, checked it in. Solved the issue.

In another case, this issue came up again. End-user received "The Specified name is already in use" since another file checked out has had the same name!

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Sunday, January 15, 2012

Incoming E-Mails with Attachments Failed - "Message size exceeds fixed maximum message size"

In Nintex workflows, some of the alert mails were failed! further investigating found this issue happens only on notification mails with attachments of 1MB+.

Moreover, There was a event logged in Event Log:
System.Net.Mail.SmtpException: Exceeded storage allocation. The server response was: 5.3.4 Message size exceeds fixed maximum message size.
System.Net.Mail.SmtpException: Exceeded storage allocation. The server response was: 5.3.4 Message size exceeds fixed maximum message size.

Checked the Exchange Server Message size limits, It was 20MB but still unable to send mails with 2MB!
After bit googling, found the issue: SMTP Server settings.
Exceeded storage allocation SMTP Settings

 After increasing the Message Size & Session Size, everything turned to good.


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


The start address is not valid for this content source type

Ever get this error when trying to add a content source in SharePoint Search?

The start address is not valid for this content source type

This is because of the option "Crawl everything under the host name of each start address" which will accept only the host names(like http://sharePoint.com) and not the Sub-site URLs(like http://sharePoint.com/sites/abc/default.aspx)

If you enter http://sharePoint.com/sub-site/default.aspx and select "Crawl only the SharePoint site of each start address" then SharePoint will crawl from the top-level site of the given URL entered. Here SharePoint will crawl from http://sharePoint.com/ and all its sub-sites.


Reference: http://technet.microsoft.com/en-us/library/cc262531(office.12).aspx

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, January 14, 2012

Truncate and Shrink SharePoint Transaction Logs, Databases

Some of the Transaction Logs and databases grown rapidly and on urgent basis I had to truncate the Log files on SharePoint Content Databases. Here is the SQL script to truncate and shrink SharePoint transaction log:

Use <database_name>
GO

ALTER DATABASE <database_name> SET RECOVERY SIMPLE
GO

DBCC SHRINKFILE (Database_Log_Name, 1); 
GO

ALTER DATABASE <database_name> SET RECOVERY FULL
GO
Important: Please note the <database_Name> and <database_log_Name> in above examples are logical names.

This sets the recovery model to "SIMPLE" temporarily, Shrink the Log file and set back to "FULL" recovery model. After executing the SQL script to truncate transaction log in my SharePoint 2010, it recovered me considerable space now!

Shrink SQL Server Database, Log Files from SSMS:
Shrinking can be done from SQL Server Management Studio also.
Go to SSMS >> Right click the target Database >> Tasks >> Shrink >> Files (or Database)
truncate sharepoint database log
Select the File Type and click on "OK" button to start shrinking. Here I've selected "Log" File type to shrink SharePoint transaction log files.
shrink sharepoint content database log
Same applies when you want to shrink SharePoint database size. I find it useful when I had to shrink SharePoint search databases.

How about removing the existing Log file and create a new one?
I had SharePoint Content database log file of 30GB! So, wanted to remove the existing log and create a new one. Simply add a new log file and remove the existing one from SSMS. Or you can:
  1.     Detach the database
  2.     Rename the log file
  3.     Attach the database without the log file
  4.     Delete the old log file
In case you don't find any decrease in log file size, Try setting the Database to Single user Mode (Go to : Database Properties >> Options >> Set "Restrict Access" to Single User ), repeat the above steps and then revert the status again to Multi_User!


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Friday, January 13, 2012

Office SharePoint Server Search is missing in Services on Server?

There is a requirement to transfer the Search Index role to another server in the farm in order to reduce the load on a particular server. So went to "Central Administration > Operations > Services on Server"

I wondered, "Office SharePoint Server Search" is missing in Servers on the Server!!!
Office SharePoint Server Search is missing in Services on Server

This is because: When you install SharePoint, You have to choose "Complete" installation instead of "Web Front End".
"Complete" installation instead of "Web Front End"


Unfortunately, There is no way to fix this other than: uninstall and Re-Install SharePoint on that particular machine.

So be careful which option you're choosing, because after a wrong decision, I had to suffer here.


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, January 11, 2012

SharePoint Farm PassPhrase: What is that? How to Reset?

What is Farm PassPhrase?

Farm Phrase is a new security feature introduced in SharePoint 2010. When you need to join the new server to an Existing SharePoint farm, you need to enter this Farm Phrase password.

While adding a new server via psconfig wizard, You have to enter the Farm's pass phrase, and then Click next to continue.

SharePoint Farm Phrase

Forgot Farm Phrase? You can Reset SharePoint Farm PassPhrase!

So, you are adding a new server to the farm and you are unable to remember that very important password? No problem! You can use PowerShell to reset the Pass Phrase. Currently there is no option to retrieve the farm's existing passphrase.

To reset the forgotten farm passphrase, Run these commands to the server which is already connected to the existing Farm.

Log-in to SharePoint server and go to Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell. right click the link and run as administrator.

How to Reset SharePoint Farm Phrase

Next step:  at the PowerShell prompt enter these cmd-lets
$passphrase = ConvertTo-SecureString -asPlainText –Force

You will be prompted to input a new passphrase in plain text.  Enter your new passphrase. and then enter
Set-SPPassPhrase -PassPhrase $passphrase –Confirm

You will be asked to confirm the passphrase by re-entering it. Re-enter the passphrase and hit Enter
You will be asked if you are sure that you want to perform this action, type Y (for Yes) and hit Enter
Your farm passphrase has now been reset!

There are some rules for Pass-phrase:
  • Minimum 8 characters length.
  • Contains at least three of the following four character groups:
  • English uppercase characters (from A through Z)
  • English lowercase characters (from a through z)
  • Numerals (from 0 through 9)
  • Non-alphabetic characters (such as !, $, #, %)

If you dont supply the complex password you will get the error message:
Set-SPPassPhrase: The Passphrase supplied does not meet the minimum complexity requirements. Please select another passphrase that meets all of the following criteria: blah blah"

For more details on the switches available just enter Get-Help Set-SPPassPhrase –Detailed



You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Monday, January 9, 2012

Consistent Top Navigation Menu across All site collections in SharePoint 2010

Requirement: Display a consistent Top Navigation Menu for across site collections in SharePoint.

We can fulfill this requirement by using custom sitemap providers in SharePoint. Here are the steps at high level
  1. Create your own sitemap file in Layouts folder
  2. Add a Site Map Provider in web.config file
  3. Add a SiteMapDataSource to your master page
  4. change the SharePoint menu's datasource to your custom SiteMapDataSource
Lets start building SharePoint 2010 common navigation across site collections.

1. Create your own sitemap file in Layouts folder

Modify the site map to match your navigation needs and save it with a .sitemap extension in a location accessible by your SharePoint farm. The _LAYOUTS directory is a great place since any site can get to that location (i.e. _/layouts/BPCorp.sitemap)

Create the sitemap as per the following template code

<siteMap>
   <siteMapNode title="Container" url="" >
   <siteMapNode title="Global Portal" description="" url="/" />
           <siteMapNode title="Finance" description="" url="~/finance" >
          <siteMapNode title="EMEA" url="~/finance/EMEA" description="" />
            <siteMapNode title="APAC" url="~/finance/APAC" description="" />
            <siteMapNode title="CORP" url="~/finance/CORP" description="" />
         </siteMapNode>
 
        <siteMapNode title="Team" description="" url="~/team" />
        <siteMapNode title="Information Technology" description="" url="~/it" />
        <siteMapNode title="Legal" description="" url="~/legal" />
        <siteMapNode title="Regions" description="" url="" >

            <siteMapNode title="North America" url="~/regions/NA" description=""/>
            <siteMapNode title="Middle East" url="~/regions/me" description=""/>
       </siteMapNode>
   </siteMapNode>
</siteMap>

Site Map control crashes with error "An unexpected error has occurred." when you point to a page in the URL (instead of Site) and that site is with broken permissions. Fix is simple: Instead of : <siteMapNode title="EMEA" url="~/finance/EMEA/default.aspx">, use: ="~/finance/EMEA">. It also crashes when you have duplicate URLs in the siteMapNode!
2. Add a Site Map Provider in web.config file
Now that you have a site map you will need to add a provider in the web.config of the application that is going to use it. The providers section starts with <providers>. You will need to add a line similar to this.

<add name="BPCorpProvider" siteMapFile="_layouts/BPCorp.sitemap"
   type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"  />

3. Add a SiteMapDataSource to your master page
Next the master page needs to be changed. Edit the Master page you will be using with this site map in SharePoint Designer. You will need to add an asp:SiteMapDataSource right above the SharePoint:AspMenu like the one shown below.

<asp:SiteMapDataSource ShowStartingNode="False" SiteMapProvider="BPCorpProvider" id="BPCorpSiteMap" runat="server"/>

5. Next you will need to change DataSourceID field in the ASPMenu to match the ID of the SiteMapDataSource as shown below. Make sure you set value for MaximumDynamicDisplayLevels="3" , otherwise you won't get sub-menus!

<SharePoint:AspMenu
      ID="TopNavigationMenuV4"
      Runat="server"
      EnableViewState="false"
      DataSourceID="BPCorpSiteMap"
      AccessKey="<%$Resources:wss,navigation_accesskey%>"
      UseSimpleRendering="true"
      UseSeparateCss="false"
      Orientation="Horizontal"
      StaticDisplayLevels="1"
      MaximumDynamicDisplayLevels="3"  
      SkipLinkText=""
      CssClass="s4-tn" />

Your code will look like this:
sharepoint 2010 consistent navigation across site collections
Save, check in, publish a major version, and approve your master page.

Please note: XML is case sensitive, and you got to replace any special codes like %20 (space) with the literal (i.e. a space). Also there are some special characters for XML like &amp; for &, &lt; for <, and &gt; for >

Finally, Here is what you will get:
Need Security trimming in SharePoint 2010 Top Navigation? Here is my another post: Security Trimmed Top Navigation Menu Using Custom Sitemap Provider for SharePoint


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


You might also like:

Related Posts Plugin for WordPress, Blogger...