Tuesday, December 16, 2014

SharePoint 2010 Search Query Suggestions

SharePoint Query suggestions (or Search suggestions), appear below the Search Box Web Part and on the search results page.



So how do we get these query suggestions? There are 2 ways to do this :

1) The first one is created automatically based on user searches.

Query suggestions depend on users' searches. Only search queries that have been previously returned and then clicked through at least six times will appear in either the search box list. Therefore, a newly deployed SharePoint Server 2010 system will not show query suggestions in either location. Moreover, a query suggestion will only appear in the search box list if the query suggestion contains at least one of the words that are typed.

2) The second once is created manually.

We can use Windows PowerShell to manually add query suggestions. The benefit of this method is query suggestions are available immediately to users of a newly installed search system. We can also supplement the default Microsoft SharePoint Server 2010 behavior by adding query suggestions for key search terms.
In this manner, you can provide query suggestions that might not be generated by the system because users are not using the search terms that would create the query suggestions that you want to appear.

PowerShell to do this:

Here we are adding the following query suggestions manually (ford, test1, test2)

$searchapp = Get-SPEnterpriseSearchServiceApplication -Identity "<SearchServiceApplicationName>"

New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "ford"

New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "test1"

New-SPEnterpriseSearchLanguageResourcePhrase -SearchApplication $searchapp -Language En-Us -Type QuerySuggestionAlwaysSuggest -Name "test2"

Start-SPTimerJob -Identity "prepare query suggestions"


There are options to turn off query suggestions so that they will not appear at query time. This is made possible by editing the Search Box Web Part.



Wednesday, December 3, 2014

How to move SharePoint list items from one list to another

If we have a list which is growing more than what was planned, it is always a good idea to split the list for performance improvement and for ease of use. There are multiple ways of doing this. Below is a simple way to do this.
For this exercise I have created 2 lists list1 and list2.My goal is to move all items from list2 to list1

1) Browse to Site Actions -> Manage Content and Structure


2) Alternatively, you can browse to Site Actions -> Site Settings -> Site Administration -> Content and structure

 
3) You are taken to the Site Content and Structure page.


4) Choose the items you want to move from list2 -> Actions -> Move


5) A pop up appears listing the destination. Choose list1


6) The move operation starts



7) list1 is populated with all items from list2.




Tuesday, November 25, 2014

ULS log Event ID 5240 “There was an error in communicating with Excel Calculation Services”

Issue Description

Recently I came across this issue where some of the end users were getting an error message when they tried to open an Excel file in SharePoint in the browser.

Unable to process the request.
Wait a few minutes and try performing this operation again.



- On checking the ULS logs I got the below error message.
ULS log Event ID 5240 “There was an error in communicating with Excel Calculation Services”

- On checking the Event Viewer on the server , there was the below error.
Event 2159, SharePoint Server
Event 5240 (Excel Services Application) of severity Error occurred 20 more time(s) and was suppressed in the event log



Cause

The Excel Services Application server computer is in a non-valid state and may need to be restarted.

Resolution

Most of the online articles were asking me to restart the Central Administration server.I did not want to do that and found a different fix.


Identify the application pool running the Excel Services service application (from IIS) and Recycle it.

1) Start –>Run –> inetmgr

2) Under the Sites click on SharePoint Web Services. This will list down the Services in SharePoint.

3) Click on each GUID –> Change the view from Features View to Content View

4) On finding ExcelService.asmx -> Right click that web service -> Manage Application -> Advanced Settings.

5) Identify the Application Pool (make a note of this).

6) Now in IIS –> Application Pools –> choose the Application Pool you noted down in previous step   -> Recycle (recycle the application pool).


Monday, November 24, 2014

SharePoint Shell Admin Access

SharePoint Shell Admin Access
To execute a command in the SharePoint 2010 Management Shell, the user should open the Management Shell on a SharePoint 2010 server. To execute commands, the user must have the necessary privileges to the SharePoint object model and to the SharePoint databases. When you are working with SharePoint objects, connections to the database are generally created with the permissions of the current user. 

In order to use Windows PowerShell for SharePoint , a user must be a member of the SharePoint_Shell_Access role on the configuration database and a member of the WSS_ADMIN_WPG local group on the computer where SharePoint is installed. 

You can use SPShellAdmin for configuring a user’s privileges and security. Here’s how. 
To run this cmdlet to add a user to the SharePoint_Shell_Access role, you must have membership in the securityadmin fixed server role on the SQL Server instance, membership in the db_owner fixed database role on all affected databases, and local administrative permission on the local computer.

1. To list Shell administrators
Get-SPShellAdmin 

2. To add a user as a Shell administrator
Add-SPShellAdmin -UserName <user name> -Database <database name> 

Note
- If you specify only the user, the user is added to the role for the farm configuration database.

- If you use the database parameter, the user is added to the role on the farm configuration database, the Central Administration content database, and the specified database. Using the database parameter is the preferred method because most of the administrative operations require access to the Central Administration content database.

$db = Get-SPContentDatabase -Site http://sharepointsiteurl/
Add-SPShellAdmin -UserName "domain\user name" -Database $db

3. To remove a user from Shell Admin
Remove-SPShellAdmin -UserName <user name> -Database <database name> 

Wednesday, November 19, 2014

Deleting a SharePoint list through PowerShell

When SharePoint lists are corrupted and you are unable to delete them from UI, you can delete them from SharePoint PowerShell. If you want to force delete a SharePoint list using PowerShell, open SharePoint Management shell and run the below commands:

$web = Get-SPWeb -Identity http://sitename
$list = $web.Lists["corrupted list name"]
$list.AllowDeletion = $true
$list.Update()
$list.Delete()

Monday, November 3, 2014

Error Message: Content Advisor Will Not Allow You to See This Site

Issue Description
When you attempt to access a Web page using Internet Explorer, Content Advisor may display the following error message:
Sorry! Content Advisor will not allow you to see this site.
The error message also indicates that the page has no rating.

Cause
This issue can occur when Content Advisor is enabled, but the "User can see sites which have no rating" option is disabled.

Resolution
This is not a SharePoint issue. This issue is an Internet Explorer Browser issue.

Please refer to this KB article for the fix

Wednesday, October 22, 2014

SharePoint 2010 .htm files prompts user to download the file

Issue Description
When the user click on a .htm file in SharePoint site , user will be prompted to save the file rather than the file opening in the browser.

Solution
1) Open Central Administration -> Manage web applications -> Select web application -> General Settings

2) Web Application General Settings -> Browser File Handling ->Strict. Change this to Permissive



Workaround

Rename your files with .aspx extension (*.aspx)

Thursday, October 9, 2014

Moving IIS SMTP Directory to a different drive location

After installing the SMTP server for enabling SharePoint incoming email feature, I had noticed that the IIS SMTP directories are by default placed in the location: C:\inetpub\mailroot
I wanted to move this to E: drive. 



The general command to do this is :
cscript.exe [directory]/[file.vbs] set smtpsvc/1/[command] [dir destination]

Below are the steps to do this:

1. Browse to Internet Information Services (IIS) 6.0 Manager
2. Right-click Default SMTP Virtual Server and Stop


3. Create the new folder locations (Copy the current inetpub folder to a different drive/partition) or manually create the necessary folders
4. Open command prompt (Run as administrator)

cd C:\inetpub\AdminScripts

Cscript.exe adsutil.vbs set smtpsvc/1/dropdirectory E:\inetpub\mailroot\Drop
Cscript.exe adsutil.vbs set smtpsvc/1/badmaildirectory E:\inetpub\mailroot\Badmail
Cscript.exe adsutil.vbs set smtpsvc/1/pickupdirectory E:\inetpub\mailroot\Pickup
Cscript.exe adsutil.vbs set smtpsvc/1/queuedirectory E:\inetpub\mailroot\Queue


6. Browse to Internet Information Services (IIS) 6.0 Manager
7. Right-click Default SMTP Virtual Server and Start


Thursday, September 18, 2014

SharePoint List View Lookup Threshold

With the release of SharePoint 2010, resource throttling was introduced at the web application level to limit the number of items a list view (database query) can process in a single request, as well as to limit the number of lookup columns a single view can utilize at one time.

By default, List View Lookup threshold is set to 8.

To view the settings page for
Central Admin -> Application Management -> Manage Web Applications -> Select the web application -> General Settings -> Resource Throttling



As per TechNet,
“Each lookup column in a list view causes a join with another table. Each additional lookup column in a view increases the complexity of metadata navigation and list view queries. In addition to standard lookup columns, single-value managed metadata, multiple-value managed metadata, single-value people and group columns, and multiple-value people and group columns count as lookup columns. Adding lookup columns to a view does not cause a gradual or linear decrease in performance, rather performance is somewhat stable until after eight columns when it rapidly degrades.”

In short, all the below column types are considered towards list view look up threshold:

- Standard lookup columns
- Single-value managed metadata columns
- Multiple-value managed metadata columns
- Single-value people and group columns
- Multiple-value people and group columns

Note

As the number of look up columns increases beyond the default value in a list, you will come across performance issues in your farm.

Friday, September 5, 2014

After Project Server migration from one farm to another, you receive an error "This Web Part was unable to load”

Issue Description
I had done a migration of Project Server environment from one farm to another. (Database detach-attach).And some of the users had the below issue when trying to access the (Project Details Pages) PDP pages.

This Web Part was unable to load.
Information that may be useful in solving this problem was written to the Unified Logging Service (ULS) log on the Project Server with the following ID:
18c06eca-de62-4544-b11a-c3440ada01e9

This problem can occur in other ways also, such as:
1) You cannot create or edit projects in PWA.
2) You cannot open Project Details Pages in Server Settings.

I checked the ULS logs with the error id and was able to fix this issue.

Cause
The PWAURL property is set to a PWA site, but none identified yet.This should be null.


Resolution
Open SharePoint PowerShell and run the below commands:

$Web = get-SPWeb http://servername/pwa
$Web.AllProperties | Format-Table

The output of the second command will show if PWAURL was set to a URL (not expected) – if so then you can change this back to NULL again using PowerShell

$Web.AllProperties[“PWAURL”]=””
$Web.Update()


Reference

ULS Log
                                                                                                                                                                                                                                                                                                                                                Web Part Exception Unique ID: 18c04eca-de79-4585-b92a-c3960ada01e9 System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.Office.Project.PWA.WebParts.ProjectFieldPartBase.GatherAndLoadCFList(Boolean bForceRefresh)     at Microsoft.Office.Project.PWA.WebParts.ProjectFieldPartBase.RebindGrid(Boolean forceRefresh)     at Microsoft.Office.Project.PWA.WebParts.ProjectFieldPartBase.PWA_OnLoad(EventArgs e)     at Microsoft.Office.Project.PWA.WebParts.PWAResiliencyPart.OnLoad(EventArgs e)          611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x1584)                                      0x1558      Project Server                             Unified Logging Service                c91s          Monitorable                Watson bucket parameters: Microsoft Project Server 2010, ULSException14, 070f6ea0 "project server", 0e001b67 "14.0.7015.0", 17ecd0fa "microsoft.office.project.server.pwa", 0e001bc2 "14.0.7106.0", 51eed0b6 "tue jul 23 14:51:34 2013", 00000c29 "00000c29", 00000077 "00000077", 4a6d3421 "nullreferenceexception", 63653972 "ce9r"               611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x1584)                                      0x1558      Web Content Management            Publishing                                   7fz3          Medium     Setting [Display] as the FormContext.FormMode for the current page    611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x1584)                                      0x1558      Web Content Management            Publishing                                   7fz3          Medium     Setting [Display] as the FormContext.FormMode for the current page    611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x1584)                                      0x1558      SharePoint Foundation                  Topology                                    e5mc         Medium     WcfSendRequest: RemoteAddress: 'http://servername:32843/d248615527544dfe8f90663b61673ee2/PSI/PWA.svc' Channel: 'Microsoft.Office.Project.Server.Interfaces.IPWA' Action: 'http://schemas.microsoft.com/office/project/server/webservices/PWA/AdminReadSiteMapTyped' MessageId: 'urn:uuid:a6cfcb4c-e800-4687-92cc-e7367ea735b0'         611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x15BC)                                      0x13FC      SharePoint Foundation                  Topology                                    e5mb        Medium     WcfReceiveRequest: LocalAddress: 'http://servername.abc.com:32843/d248615527544dfe8f90663b61673ee2/PSI/PWA.svc' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http://schemas.microsoft.com/office/project/server/webservices/PWA/AdminReadSiteMapTyped' MessageId: 'urn:uuid:a6cfcb4c-e800-4687-92cc-e7367ea735b0'         611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x15BC)                                      0x13FC      SharePoint Foundation                  Monitoring                                  nasq          Medium     Entering monitored scope (ExecuteWcfServerOperation)         611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x15BC)                                      0x13FC      SharePoint Foundation                  Monitoring                                  b4ly          Medium     Leaving Monitored Scope (ExecuteWcfServerOperation). Execution Time=6.5183       611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x1584)                                      0x1558      Project Server                             General                                      ce9r          Exception   Web Part Exception Unique ID: 18c04eca-de79-4585-b92a-c3960ada01e9 System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.Office.Project.PWA.WebParts.ProjectFieldPartBase.ReplacePlaceHoldersWithCustomFieldControls()     at Microsoft.Office.Project.PWA.WebParts.PWAPart.PageLoadCompleteInternal(Object sender, EventArgs e)    611d75ae-a62e-46c4-b3a9-b9311f4dc02a
w3wp.exe (0x1584)                                      0x1558      Project Server                             Unified Logging Service                c91s          Monitorable                Watson bucket parameters: Microsoft Project Server 2010, ULSException14, 070f6ea0 "project server", 0e001b67 "14.0.7015.0", 17ecd0fa "microsoft.office.project.server.pwa", 0e001bc2 "14.0.7106.0", 51eed0b6 "tue jul 23 14:51:34 2013", 00000c09 "00000c09", 00000011 "00000011", 4a6d3421 "nullreferenceexception", 63653972 "ce9r"               611d75ae-a62e-46c4-b3a9-b9311f4dc02a

w3wp.exe (0x1584)                                      0x22A4      SharePoint Foundation                  Monitoring                                  nasq          Medium     Entering monitored scope (Request (POST:http://abc.xyz.com:80/PWA/_vti_bin/PSI/Workflow.asmx))             

Thursday, September 4, 2014

SharePoint 2013 People Picker not working for domain security groups for List and Document Library Alerts

Issue Description

1. Not all the groups are being resolved by document library/list people picker.

2. You cannot send alerts to a security group instead of a user.

3. Even if some of the groups are being resolved, the alert emails are still not being sent.

Users were unable to setup email alerts on Document library "library1" on SharePoint site "http://mysitename/sites/site1/" for some Active directory groups "domain\ADGroup"

Product Version: SharePoint 2013

You get the below error message:
Unable to set alerts to domain security groups with error "We couldn't find an exact match" or “Sorry, you are not allowed to share this with external users.”


Cause
I had opened a ticket with Microsoft for this issue and worked with them and they finally confirmed this is a bug with SharePoint 2013. This issue has been fixed with May 7, 2014 Cumulative Update for SharePoint 2013.

Resolution

1) Log in to the all the SharePoint Servers in the farm. Browse to C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS

2) Make a copy of SubNew.aspx .Now modify the SubNew.aspx . Search for <wssawc:ClientPeoplePicker

3) Paste the below text after the section SelectionSet="User,SecGroup" :

PrincipalAccountType="User,SecGroup"

Wednesday, September 3, 2014

AD Groups not displayed in SharePoint People Picker

Issue description
A user had created and Active Directory group and was not able to see the group in SharePoint People Picker
SharePoint version: SharePoint 2010 SP2

Cause                                                                                                                                             
The Active Directory group was created as a Distribution group

Resolution                                                                                                                                   
Active Directory groups should be a created as Security group (not Distribution group) to get listed in SharePoint People Picker.




Distribution groups cannot be used as security instances, such as assigning permissions to them. SharePoint uses Active Directory to authenticate a user. In order to do this, it must be a security principle that SharePoint is working with. Distribution groups are not security principles. 

Restore-SPSite : The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly

Issue Description
I had recently come across this error while trying to restore a SharePoint 2010 site.

Restore-SPSite : The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly

Cause
This could be because there is some error on your web.config files.

Resolution

Check the below web.config files 
1) Central administration
2) Specific SharePoint Web application
3) Security Token Service

1) Make sure that there are no spaces in the web.config file
2) There should not be duplicate nodes
3) Make sure all nodes are entered properly in the web.config files (especially when you are working with forms based configuration).

Thursday, August 28, 2014

The file or folder name contains characters that are not permitted. Please use a different name.

The file or folder name contains characters that are not permitted. Please use a different name.

When you try to create a folder name or list in SharePoint you might have come across this error.The reason is that there are some restrictions on the characters that you cannot use in site names, folder names, and file names in SharePoint.



Site names, subsite names, or site group names
You cannot use the following characters anywhere in a site name, in a subsite name, or in a site or Active Directory group name:
- Tilde (~)
- Number sign (#)
- Percent (%)
- Ampersand (&)
- Asterisk (*)
- Braces ({ })
- Backslash (\)
- Colon (:)
- Angle brackets (< >)
- Question mark (?)
- Slash (/)
- Plus sign (+)
- Pipe (|)
- Quotation mark (")

You cannot use the above characters anywhere in a folder name or a server name or in a file name
More details on this can be found at Reference

Tuesday, August 26, 2014

The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

Issue

SharePoint Management shell was giving errors : The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered

Cause

The below software were installed and this caused a compatibility issue with SharePoint.

Microsoft .NET Framework 4 Extended                   4.0.30319
Microsoft .NET Framework 4 Client Profile               4.0.30319

Resolution

Uninstalled the above software from the SharePoint servers.