Archive

Posts Tagged ‘SharePoint 2010’

How to rebuild Search Service Application in SharePoint 2010

May 31, 2012 3 comments

1) Open SharePoint Management Shell as an administrator

 

Delete the Search Service Application

 

2) Locate the GUID for the search service application by typing

 

Get-SPServiceApplication |?{$_.name -eq “<name of the search application>”}

 

3) Copy the names of the Databases associated with the Search Service Application

4) Run the following stsadm command

 

Stsadm.exe –o deleteconfigurationobject –id ‘<GUID>’

4 ) Delete the following databases from SQLManagementStudio . The exact names are copied under Step 3.

CrawlStoreDB

DB

PropertyStoreDB

 

5) Delete the index files from Program Files\Microsoft Office Servers\14\Data\Office Servers\Applications

 

6) Go to Central AdministrationàManage Service Applications

7) Click New Search Service Application

8) Provide a name to the application and select the managed account and Click Ok

Wait for the confirmation

Configure the new Search Service Application

 

9) Add the existing portal address in the content sources and setup Full Crawl and Incremental crawl.

10) Run full crawl

 

 

 

 

March 27, 2012 Leave a comment

Recently I  came upon a requirement where the client  wanted the People Picker field to populate automatically with a user name depending on the some criteria and  not be able to change it.
I know I can disable the field but with the “Browse” icon a user can still change the People Picker value.
 So in order to hide the “Browse” field I went on a journey to figure out and finally found an easy way …
var divs1 = document.getElementsByTagName('a');    // Locate the "a" tag on the page
var z = 0;
for(var i =0; i < divs1.length; i++) //Loop through to find the browse icon
{
if(divs1[i].<a class="zem_slink" title="Internet Explorer" href="http://www.microsoft.com/windows/internet-explorer/" rel="homepage" target="_blank">innerHTML</a>.indexOf('addressbook.gif') > 0) // The name of the image is "addressbook.gif"
{
z++
if (z == 3)  // you have to manually count the total number of PeoplePicker on the page and target the one you want to disable
{
divs1[i].innerHTML = "</pre>
<img title="Browse" src="\&quot;/_layouts/images/addressbook.gif\&quot;" alt="Browse" />
<pre>"   // Append the innerHTML with display:none 
}
}
}

Calculate number of weekdays between two date fields

February 22, 2012 Leave a comment
Categories: SharePoint Tags:

Columns from SharePoint list are missing ( Created or Modified) in SharePoint 2010

January 31, 2012 Leave a comment

Both Created and Modified columns went missing in my site collection. I found the solution here :

http://sharepointtechie.blogspot.com/2010/04/created-and-modified-field-went-missing.html

Categories: SharePoint Tags:

Create a list in all the sites using Powershell

September 20, 2011 3 comments

Here is way to create a list based on a custom template using Powershell. The script will go through each site and create the list and add them to the Quick Launch


$GetSites = Get-SPWebApplication | Get-SPSite | Get-SPWeb -Limit ALL
foreach($getsite in $GetSites)
{
$listTemplate = $getsite.Site.GetCustomListTemplates($getsite)
$getsite.Lists.Add("MyList","My List",$listTemplate["MyTemplate"])
$list = $getsite.Lists["MyList"]
$list.OnQuickLaunch = $true
$list.Update()

}

Make sure that custom template is uploaded in the List Template Gallery. Check out this link  if you want to add a list template using powershell

Great blog about SharePoint Features , Elements and Scopt

July 12, 2011 1 comment

This blog helped me a lot in determining the scope of feature deployments.

http://weblogs.asp.net/soever/archive/2007/05/03/sharepoint-features-elements-scope-and-other-info.aspx

Categories: SharePoint Tags:

Comments History not showing on Custom Display Form

April 4, 2011 2 comments

Creating Custom Display Form in SharePoint Designer for a List does not show history for Comments field by default.
Here is the fix for that:

Replace:

<xsl: select=”@V3Comments” value-of disable-output-escaping=”yes”  />

Add:

<SharePoint:AppendOnlyHistory runat=”server” ControlMode=”Display” FieldName=”V3Comments” ItemId=”{@ID}”  />

This should fix the issue and start showing all the comments added in the Comments Field.