Pages

Monday, December 27, 2010

Configuring PerformancePoint Services with Microsoft SharePoint 2010

Hello Friends
To configure PPS (PerformancePoint Services) for Microsoft SharePoint 2010, we need to follow below steps
1. Configure the Secure Store Service.
2. Create the service application.
3. Start the PerformancePoint Service.
4. Configure other service applications which will be useful in the deployment, like Excel Services, SQL Server Reporting Services Integration.

Let us look at every step one by one

How to configure the Secure Store Service, follow these steps:
  • Browse the SharePoint 2010 Central Administration.
  • Select the Application Management tab and then select Manage Service Applications.
  • Look for Secure Store Service and select, and then click Manage on the ribbon
  • It will open Secure Store Service configuration page, select Generate New Key from ribbon.
  • Enter a strong secure passphrase in the dialog box. Because it is protecting potentially sensitive data. Accept the check to Re-encrypt the Database Using the New Key, and then click OK. The database will be encrypted.
  • It will create the Secure Store Service key successfully and the database is encrypted.

Creating the Service Application follow these steps:
  • Start the PerformancePoint Service.
  • Create the PerformancePoint service application.
  • Set the Unattended Service Account.
  • Associate the service application proxy with a proxy group.

To start the PerformancePoint Service, follow these steps:
  • Open the SharePoint 2010 Central Administration site, and then click the System Settings tab in the navigation pane on the left.
  • From this page, click the Manage Servers.
  • From the list of servers in the farm, select the name of the server where you want to start the service application.
  • Look for PerformancePoint Service in the list of available services, and then click Start from the Action column. Once it is started ,then the status changes from Stopped to Started
To create the PerformancePoint service application, follow these steps:
  • Browse to the SharePoint 2010 Central Administration site, and then click Application Management tab in the left navigation pane.
  • Select the Manage Service Applications from Service Applications.
  • From the ribbon, click New. Click PerformancePoint Service Application to launch the PPS Service Application creation dialog box
  • Enter a name for the service application. If this is going to be the default service application, select Add This Service Application’s Proxy to the Farm’s Default Proxy  List.
  • In the Application Pool section of this screen, you can select to either Use Existing Application Pool or Create New Application Pool. If you decide to select Create New Application Pool, enter the application pool name. After you have made your selection, click Create to create the service application. This may take a few minutes. When the process has completed, you see a message confirming a successful creation.
Set the Unattended Service Account follow these steps:
  • From the Service Application Management screen, select Application Management, Manage Service Applications.
  • Scroll to find and select PerformancePoint Service Application from the list, and then select Manage from the ribbon.
  • From the PerformancePoint Service Application Management page, select PerformancePoint Services Settings.
  • Secure Store Service is selected as the default in this screen. If you plan to use the Unattended Service Account to access data sources, enter credentials in this screen, and then click OK
Hope this helps
Disha Shah

Sunday, December 19, 2010

Fajax - the fake alternative to ajax

Hi Readers
There is one problem we are facing now-a-days in our website when it renders all images are coming one by one horizontally. All the pages of websites are flickering.
The solution of the problem is add these metatags inside the master page.
<META http-equiv="Page-Enter" content="blendTrans(Duration=0.2)">
<META http-equiv="Page-Exit" content="blendTrans(Duration=0.2)">
This known as “Fajax”: The fake alternative to ajax.
When a page posts back (for example when you click a button on a form), it normally causes a screen flicker as the page is redrawn.
A lot of the time, this gives an identical effect to an ajax style http request. The page appears to have stood absolutely still as just one part of it is updated.
This simple trick gives you about 50% of the benefit of ajax, with a 1% of the effort.
Disha Shah

Friday, December 10, 2010

FAQs related SharePoint Service Pack 2 and the Cumulative Updates

Hi Friends
Please refer below link for concerning SharePoint Service Pack 2 and the Cumulative Updates for April 2009 for the 2007 Microsoft Office System and Microsoft Office servers
Disha Shah

Configuration Of SharePoint Products And Technologies Failed,After Apply SharePoint Service Pack2

Hi
Before some days working on upgrading SharePoint Serves and applying SharePoint Service Pack2.
There are two SharePoint ServicePacks 2 are available which should be applied one after another in sequence.
  1. Download WSS 3.0 SP2 either 32 bit or 64 bit depends on your machine configuration from this link
  1. Download MOSS  SP2 either 32 bit or 64 bit depends on your machine configuration from this link
  1. First apply WSS 3.0 SP2 on server and after it ends , it asks for Configuration Wizard click on Cancel
  2. Apply MOSS SP2 , once it is done it will ask for Run SharePoint  Products and Configuration Wizard.
When I run that , it gives me error on step number 8. I checked the SharePoint Server Version, it looks good , it has upgraded for SharePoint SP2. It has given the below error.



Then I tried to find out from where the source of the error from the Log files, it did not give me good explanation. I checked the upgrade.log file and I read line by line log and I found out one of line which says the upgrading one of the SharePoint site has terminated with X number of errors and warnings.
I checked that SharePoint Site and it gives me errors and then I realized that that site was always throwing error when I tried to open that SharePoint Site.
Then I deattach the Content Database of SharePoint Site from Central Administration and once again I have run the SharePoint Products and Technologies Configuration Wizard and it runs perfectly.
This is one of the scenario for failing the SharePoint Products and Configuration Wizard. There are so many possibilities why error has occurred, and every problem has different solution, please read log files well.
Hope this helps
Disha Shah

Thursday, December 9, 2010

SharePoint Site which uses Form Based Authentication redirects to a diffrenet Login Page during signout

Hello readers
Requirement:
When user clicks in either “Sign out” or “Sign in as different user”, they should redirect to the different login page not the default page in case of Form Based Authentication (FBA).
Solution:
We can do that by extending class with the “IHttpModule”. We have to write this two methods to redirect to a new page.
public void Init(HttpApplication app)
        {
            app.BeginRequest += new EventHandler(app_BeginRequest);
        }

        void app_BeginRequest(object sender , EventArgs e)
        {
            HttpContext context = HttpContext.Current;

            if (context.Request.Url.PathAndQuery.ToLower().Contains("/_layouts/accessdenied.aspx?loginasanotheruser=true") || context.Request.Path.ToLower().Contains("/_layouts/signout.aspx"))
            {

                context.Response.Redirect("redirectnewpage.aspx");

            }
        }
How to deploy?
  1. Put DLL inside theGAC and put the same dll inside bin folder of the webdirectory.
  2. Open the web.config file and add this section
Under <httpModules>
<add name="LearningVillageSigout" type="LearningVillageSigout.HttpModule" />

  1. Do IISRESET.

Wednesday, December 8, 2010

Moving SharePoint Content database from one drive to another on same server

Hello friends

Before some days my c: drive becomes full so I decided to move the all SharePoint content database files from c: drive to D: drive , how to do that?

Let us see step by step procedure
  1. Run DBCC CHECKDB command first to check there are no consistency errors on the content database or not.
  2. For safer side take the backup of content database before you start the moving process. You can take the backup of any SQL Database by following this method.
  3. Go to ->Microsoft SQL Server Management studio -> Databases->Content Database->Task->Backup
  4. Right click SharePoint database name, select Tasks -> Detach. Check Drop connection if there are active connections.
  5. Using Windows Explorer, copy the existing Primary Data File, Secondary Data File, and Transaction Log from location on C(old) drive and Paste these files into new folder on D(new) drive
  6. Run following command in query windows.
  7. use master
    EXEC sp_attach_db @dbname = N'WSS_Content_DatabaseName',
    @filename1 = N'D:\MSSQL\Data\WSS_Content_DatabaseName.mdf',
    @filename2 = N'D:\MSSQL\Data\WSS_Content_DatabaseName.ldf'
  8. Run DBCC CHECKDB command again to check there are no consistency errors on the content database after moving. Query message should show 0 allocation errors and 0 consistency errors.
  9. Make sure that SharePoint application is running properly after content database move.
  10. Done.
Disha Shah

Tuesday, December 7, 2010

SharePoint Designer 2010: Fix the Width of a Master Page

Hello Friends,

We can add an embedded style sheet that will fix the width of pages inheriting from this master page. Let us look at step by step procedure.

1. Open a your sharepoint site in SharePoint Designer 2010.
2. Select the Master Pages section of Site Objects.
3. Create a new master page,name it mycustom.master.
4. Right-click on the file and select “Set as Default Master Page.”
5. Right click on the file and select “Edit File in Advanced Mode.”
Add the following embedded style sheet into the master page just before the closing </head> tag:
<style type=”text/css”>
/*fixed width */
#s4-workspace > div,#s4-bodyContainer > div,body #s4-titlerow > div{
width:1000px;
margin:0 auto;
float:none;
padding:0;
}
body #s4-mainarea{
/*make main area have background of white and add a border */
background:#fff;
border:1px solid #ddd;
border-top:0px;
min-height:580px;
/*contain content in all browsers but IE7 */
display:table;
}
/*add padding back to title table*/
.s4-title-inner{
padding:0 0 0 5px;
}
/*background color of site*/
#s4-workspace {
background:#efefef /*none*/;
}
/*body container */
#s4-bodyContainer{
position:relative;
width:100%;
}
/*fix overhanging tables*/
.ms-v4propertysheetspacing
{margin:0;}
</style>
6. Save and check in your changes.

Check the width has been changed!!!

Hope this helps!!!

Disha Shah

Monday, November 22, 2010

Windows SharePoint Services Timer Service- Unable to start the Timer Service- Showed error -Pathto the executable not found.

There was a problem with Farm Backup and I checked All WSS Services are running or not. “Windows SharePoint Timer Service” was not running , then I start manually and it throws this error.
“Could not start the Windows SharePoint Services Timer Service on Local Computer. Error 3:The System cannot find the path specified”.





Then I checked that “Path to executable” Path was blank. How to set to “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN\OWSTIMER.EXE”

We can do the same thing with Registry Edit.
Got to Start -> Run -> type “regedit”, it opens Registry Editor

You can see these screens.
 






    Go to SPTimerV3 and check the “ImagePath” Property value and set with “C:\Program Files\Common    Files\Microsoft Shared\Web Server Extensions\12\BIN\OWSTIMER.EXE”
Now restart the service , it runs!!!
Disha Shah

Backup hangs at [Shared Search Index] 50 percent complete

When I was taking the Farm Backup of SharePoint through the command prompt with this command, “stsadm -o backup -directory <\\server name\folder name> -backupmethod full”
What can be the problems? One of the problems in my case was.
Checked your Windows SharePoint Services all are running or not specially “Windows SharePoint Services Timer Service”, “Windows SharePoint Services Search Service”
In my case there is a problem with “Windows SharePoint Timer Service”, I restarted and I have taken the successfully backup of Entire Farm.

Enjoy!!
Disha Shah

Windows SharePoint Services Timer Status is Stopping

Hello Readers,

I have started to take the backup of SharePoint Farm on one SharePoint server through SharePoint Central Administration.

But it was not giving me any status for starting, Central Admin has given one tips that if it does not automatically start, check Timer Job Definitions or Timer Job Status.

I went to Timer Job Status from SharePoint Central Administration -> Operations->Timer Job Status (Timer Job Status, you will find under “Global Configuration” Sections of “Operations”.

I checked “Application Server Administration Service Timer Job” was initialized but did not success .Then I went to Start->Administrative Tools->Services and I have restarted and it gives me this error .

"Windows SharePoint Services Timer Status is Stopping"


How to solve the problem:
Let us look at the step by step process.
1> End OWSTimer.exe Process from the task manager
      a.       Go to Task Manager and in Process Tab find the OWSTimer.exe, select that process and click button “End Process”.
2>  Click on Windows SharePoint Service Timer, Go to recovery tab, Change Setting of First Failure and Second Failure.
3>  First Failure Change options to Take No Action
4>  Second Failure Change options to Take No Action


5>     Press Ok and Press F5 Refresh Service Page.
6>     Now you can find the “start” option, start it and it is running now.
You have solved the Problem!!!
Enjoy!!
Disha Shah


Sunday, November 21, 2010

Sharepoint 2010 - LIST OF MAPPING OF VIRTUAL FOLDERS WITH PHYSICAL FOLDERSPATH

Hey All

Here you can find a list of Mapping of Virtual Folders With Physical Folder Path in Sharepoint 2010.

LocalDrive:\>iisvdir/query “Sharepoint-80”

No.


Alias


Physical Root

1>/_controltemplatesLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES
2>/_layoutsLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS
3>/_vti_binLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\ISAPI
4>/_wpresourcesLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources


LocalDrive:\>iisvdir/query “sharepoint Central Administration v3”

No.AliasPhysical Root
1>/_adminLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\ADMIN
2>/_controltemplatesLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES
3>/_layoutsLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS
4>/_vti_admLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\ADMISAPI
5>/_vti_binLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\ISAPI
6>/_wpresourcesLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources


LocalDrive:\>iisvdir/query “Office Server web services”

No.AliasPhysical Root
1>/SharedServices1LocalDrive:\Program Files\Microsoft Office Servers\14.0\WebServices\Shared


LocalDrive:\>iisvdir/query “Sharepoint - 46281”

No.AliasPhysical Root
1>/_controltemplatesLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES
2>/_layoutsLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS
3>/_vti_binLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\14\ISAPI
4>/_wpresourcesLocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\wpresources


So Find out files!!!
Disha Shah

Thursday, November 18, 2010

Make Sharepoint Sites for ReadOnly Access during maintance mode

Hello Friends
We have requirement in which we need to make all SharePoint sites on maintained mode and do now allow users to modify anything.
They should go through pages but they should not add or modify any content on SharePoint sites.
How we can do that?
As we know command line tool of SharePoint STSADM is very powerful, we can use one of operation of Stsadm that is Setsitelock
Make one batch file and repeat the same coomand for all sharepoint sites which should go to the readonly access
stsadm -o setsitelock -url http://SharepointSiteURL -lock Readonly
For more information for setsitelock, refer this link.
http://technet.microsoft.com/en-us/library/cc262811(office.12).aspx
Hope this helps!!!
Disha Shah

Sharepoint_Config Suspect Mode

Hello Friends
Just Browse to SharePoint Site and got the error which is a general issue "Cannot Connect to the configuration database"
I have looked into all common resolutions, Checked all services are running or not, especially SQL Server and yes it is running.
Then I just logged in into the "SQL Server management Studio" and check databases where all are functioning normally or not.
I saw "Sharepoint_Config(suspect)." I scared but there is a very simple solution available for that .Just run this to recover the database may be you lose your some of data but it will recover and run your SharePoint successfully.
EXEC ALTER DATABASE yourSharepoint ConfigDBname SET EMERGENCY
DBCC checkdb('yourSharepoint ConfigDBname')

ALTER DATABASE yourSharepoint ConfigDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('yourSharepoint ConfigDBname', REPAIR_ALLOW_DATA_LOSS)

ALTER DATABASE yourSharepoint ConfigDBname SET MULTI_USER sp_resetstatus 'yourSharepoint ConfigDBname';

Hope this scripts helps some one's life!!

Enjoy
Disha Shah

Friday, November 12, 2010

Wednesday, November 3, 2010

PowerShell Command Editor

Where we can write PowerShell Commands?
If SharePoint Server is running we can write PowerShell Commands with the two ways
1> Start Menu --> SharePoint 2010 Management Shell
2> From command prompt write: PowerShell

We can check the list of installed snap-ins by using this command:
Get-PSSnapIn
 Disha Shah

PowerShell OverView and Examples with SharePoint 2010

OverView:
PowerShell is a command line scripting tool which introduces the concept of a cmdlet, those commands that are derived from the System.Management.Automation .Cmdlet class and are created using the .NET Framework.
For Example,
(Get-SPWeb -Identity http://localhost).Title
or
$RootSite=Get-SPWeb -Identity http://localhost
$ RootSite.Title
Examples:
  • Setting Properties on SharePoint Objects
           $ RootSite =SP-GetSPWeb -Identity http://siteurl
           $ RootSite.Title="My First Site"
           $ RootSite.Update()
  • Connecting to SharePoint Remotely
          Powershell is very powerful; with the powershell we can connect with remote machine and  open a PowerShell session on a client machine.
         To enable remoting on the server, enter the following command:
         Command: Enable-PSRemoting
         To connect to any machine by entering the following command:
         Command: Enter-PSSession "Server Name" -Credential (Get-Credential)
         Once a remote connection has been established, the SharePoint snap-in can be added with the  command:
         Command: Add-PSSnapin Microsoft.SharePoint.PowerShell
  • Working with Timer Jobs
             Get-SPTimerJob | Select -Expand HistoryEntries | Where {$_.Status -ne "Succeeded"} |
             group JobDefinitionTitle
Like these , We can do so many operations by running different commands of PowerShell like “Create/Delete  Site Collections and Site”, ”Properties on Sharepoint Objects”,”Lists and Libraries” etc.
Disha Shah

Error Handling in Sharepoint 2010 via Programming (Object Model)

SharePoint exceptions are derived from the SPException class.


Below code gives you example for write error logging details to the SharePoint Unified Logging Service (ULS) logs.


void ErrorEntry()
{

        try
        {
             //Development code

        }
       catch (Exception ex)
       {
             SPDiagnosticsCategory diagnosticsCat = new SPDiagnosticsCategory("categoryName" ,  TraceSeverity.Monitorable , EventSeverity.Error);

SPDiagnosticsService.Local.WriteEvent(1 , diagnosticsCat , EventSeverity.Error , "Error Message" , ex.StackTrace);

       }
}

Disha Shah

INFOPATH 2007 TRUST LEVEL

When I deployed InfoPath form to another environment, I found it misbehaved something because of trust level problems.

So let us talk about Trust Levels related to InfoPath form and how we can modify?
Trust Levels


Normally InfoPath 2007 decides automatically pick up security level which needed to an InfoPath form.


A security level determines which features are available to the InfoPath form.
  • Full trust security level
  • Domain security level
  • Restricted security level
How to change Trust Level depends on Requirement?

At design time, InfoPath 2007 will automatically choose the security level which provides the minimum amount of permissions that are required to perform the form successfully. To change different security level we have to perform some operations manually.


You can do this by setting the security level and signing the form template with a certificate in InfoPath Tools -> FormOptions.

This opens the Form Options window, where you can select the Security and Trust category. You can also specify a digital certificate that you want to use to sign the formtemplate.




























More Inforamtion For InfoPath Forms are located here. please refer to the following location:

Disha Shah

Overview and Difference between Sandboxed solution and Farm solution For SharePoint Project Type in Visual Studio 2010

In SharePoint 2010, we can create two types of solution
1>     Sandboxed Solution
2>     Farm Solution.
So what is difference between these two solutions?
Sandboxed solutions: Run in a secure, monitored process. Sandboxed solutions can be deployed without requiring SharePoint administrative privileges. If you choose a sandboxed solution, you can only use project item types that are valid in sandboxed solutions.
Farm solution:  In this solution all SharePoint project item types in are available, but deployment needs administrative privileges and the solution must run in FULL TRUST permission LEVEL.
Which solution needs to select?
Sandbox solution is best because of following reasons.
·         It will deployed at the site collection level rather than the farm level, so it allows us to this lets you separate a solution so it is only offered to one site collection within the farm.
·         Sandboxed solutions also run in a separate process from the main SharePoint IIS web application process, and the separate process is throttled and monitored with quotas to guard the SharePoint site from becoming unresponsive due to a misbehaving sandboxed solution.
·         Users can deploy solutions not including requiring administrator agreement

Many useful features provide by Sandboxed solution then why we need Farm Solution?
If Code requirements to run at the Web Application of Farm Level or talk with multiple site collection, in that case we should  go for Farm Solution

Disha Shah

Tuesday, November 2, 2010

How to Hide ItemToolbar in SharePoint 2007?

Hello


We have business requirement which indicates that User should not see entire toolbar when they view any item, how to disable that?
Simple Approach with JavaScript inside the ContentEditor Webpart

<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("hideFields");
function hideFields() {
   var control = document.getElementById('controlID');
    control.style.display="none";
}
</script>

NOTE: you can find the control ID by downloading Internet Development toolbar and just select that element it will show that control ID.

Disha Shah

Alert Box in Sharepoint Pages

Hello Friends

Sometimes we need to provide users some messages or warning alert box when they save or delete data.

How to do that? Very Simple, No need for coding!!

We need to add a simple JavaScript code  in content editor webpart on a particular page where we need to popup that alert box.

Here is a sample of code

<script language="JavaScript">
function PreSaveAction()
{
alert('Your Information has been successfully saved');
return true;
}

Disha Shah

Thursday, October 28, 2010

Custom Enterprise Search Webpart in SharePoint 2007

Normally we use out of the Box SharePoint Search, but sometimes there is custom requirement in which we need to use Custom Search Webpart.
Here is a small portion of code to write for custom Enterprise Search Webpart.
Sample Code:

protected System.Web.UI.WebControls.DataGrid grdEntrerpriseSearchResults = new DataGrid();

protected override void CreateChildControls()
{
string strSearchQry;

using (SPSite site = new SPSite(SPContext.Current.Site.Url .ToString()))
            {
               strSearchQry = BuildFullTextSqlQuery(false);
Microsoft.Office.Server.Search.Query.FullTextSqlQuery qryFullText = new Microsoft.Office.Server.Search.Query.FullTextSqlQuery(site);
               qryFullText.QueryText = strSearchQry;
               qryFullText.ResultTypes = Microsoft.Office.Server.Search.Query.ResultType.RelevantResults;
               qryFullText.TrimDuplicates = true;
               qryFullText.EnableStemming = true;
               qryFullText.RowLimit = 50;
               qryFullText.Timeout = 120000;
               Microsoft.Office.Server.Search.Query.ResultTableCollection results = qryFullText.Execute();
               Microsoft.Office.Server.Search.Query.ResultTable relevantResults = results[Microsoft.Office.Server.Search.Query.ResultType.RelevantResults];
               DataTable resultsDataTable = new DataTable();
               resultsDataTable.Load(relevantResults, LoadOption.OverwriteChanges);
               grdEntrerpriseSearchResults.DataSource = resultsDataTable;
               grdEntrerpriseSearchResults.DataBind();

            }

            this.Controls.Add(grdEntrerpriseSearchResults);
        }

        private string BuildFullTextSqlQuery(bool bDocumentsOnly)
        {
            string sRetval = string.Empty;
            string sSelectQuery = "SELECT Title, Path, Size, HitHighlightedSummary FROM Scope() ";
            string sWhereQuery = string.Empty;

            sWhereQuery = " WHERE (\"SCOPE\" = 'SiteName') AND (IsDocument=1) ";

           if (bDocumentsOnly == true)
                 sWhereQuery = " WHERE IsDocument=1 AND (\"SCOPE\" = 'All')";
             else
                 sWhereQuery = " WHERE IsDocument=0 AND (\"SCOPE\" = 'All')";
      
            sWhereQuery += " AND FREETEXT(*, 'Keyword') ";
            string sOrderByQuery = "  ORDER BY Rank DESC ";
         
            if (bDocumentsOnly == false)
            {
                sWhereQuery += " AND ContentClass='STS_Web'";
            }

            sRetval = sSelectQuery + sWhereQuery + sOrderByQuery;
        
            sRetval = sSelectQuery + sWhereQuery + sOrderByQuery;
            return sRetval;
        }

Disha Shah