Thursday, September 22, 2016

How to Force Log In To Remote Desktop Computer When The Session is Already Full

Use the below command in Run

mstsc /v:[SERVERNAME] /admin

That should force you into the server if the session is full.

No content databases in the web application were available to store your site collection

Recently I had tried deleting a site collection and tried restoring the site with the same URL and I got the below error

Restore-SPSite https://sitecollectionurl -Path "E:\filename.bak" -Force

“ Restore-SpSite : The operation that you are attempting to perform cannot be completed successfully. No content databases in the web application were available to store your site collection. The existing content databases may have reached the maximum number of site collections, or be set to read-only, or be offline, or may already contain a copy of this site collection. Create another content database for the Web application and then try the operation again “

How to fix this

Restore-SPSite https://sitecollectionurl -Path "E:\filename.bak" -Force –DatabaseServer "DBServerName" -DatabaseName "DBName"

And it worked this time. Site was successfully restored.
This happened because I was trying to restore or create a new site with the same url that was deleted some time back. There is a chance it has not been removed from the database permanently

Alternatively, to delete the old site, do the below steps


If the site exist with the same URL remove using

Remove-SPDeletedSite -Identity

Tuesday, August 9, 2016

How to Add/Modify your Hosts file

1. Go to  Start -> All Programs -> Accessories -> Notepad

2. Type Notepad in the search field, Right-click Notepad and select Run as administrator.

3. From Notepad, open the following file: C:\Windows\System32\Drivers\etc\hosts

4. Make the required entries to the file.

5. Click File -> Save to save your changes.

Tuesday, June 28, 2016

How to add a user to Web Application User Policy using PowerShell

To add a user to web application user policy using PowerShell , use the below PowerShell script

$userOrGroup = "i:0#.w|domain\user"
$displayName = "User-NTLM"

$webApp = Get-SPWebApplication("URL")
$policy = $webApp.Policies.Add($userOrGroup, $displayName)
$policyRole = $webApp.PolicyRoles.GetSpecialRole([Microsoft.SharePoint.Administration.SPPolicyRoleType]::FullControl)

Thursday, June 23, 2016

You need to be a site collection administrator to set this property.

Issue Description

Recently I was trying to add a site collection administrator to a site and I got the belowmessage

You need to be a site collection administrator to set this property.   at Microsoft.SharePoint.ApplicationPages.ManageSiteAdminPage.BtnSubmit_Click(Object sender, EventArgs e)
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I was already the site collection administrator to the site and it did not make any sense.


On further trouble shooting, I found the solution for this.Browse to Central Administration - > Site Collection Quotas and Locks.

The options available here are:

       Not locked
Adding content prevented
Read-only (blocks additions, updates, and deletions)
No access

This site collection was in Read-only status. Unlock it (Change the status to  "Not Locked")

Tuesday, March 29, 2016

SharePoint 2013 Designer Workflow is not started and the initiator is Anonymous

Issue Description

Workflow created using SharePoint designer is not getting started and the initiator is Anonymous.
Recently I ran across an issue where a SharePoint Designer workflow associated with a list was showing the below symptoms. It was a simple list and a basic workflow sending an email. 
The status of the workflow showed :

Initiator : Anonymous and Internal Status : Not started

Screenshot below

How to fix this

1. Make sure that the below services are in Running state

Workflow Manager Backend
Service Bus Message Broker
Service Bus Gateway

Windows Fabric Host Service (FabricHostSvc)

2. Restart the WorkflowServiceBackend service

net stop WorkflowServiceBackend
net start WorkflowServiceBackend

Wednesday, March 23, 2016

Restore-SPSite : 0x80070003

Issue Description

I was trying to do a backup and restore operation between SharePoint farms and got the below error message:

Restore-SPSite : <nativehr>0x80070003</nativehr><nativestack></nativestack>


            Make sure that the source and target SharePoint farms are in the same SharePoint build versions.

Monday, March 14, 2016

SharePoint 2013 Query Suggestions

Query suggestions are phrases that you want the search system to suggest to users as they start typing a query. For example, as you start to type "Chicago", they may be able to pick  a word that starts with "Chicago" from a list below the Search Box.

The Query Suggestion feature needs to be enabled at the Service Application level to be activated.Once this is done there are 2 ways to implement query suggestion.

1. Manually upload the query suggestion list into SharePoint.

2. The search system automatically creates suggestions for a query when users have clicked one or more of the results for that query at least six times.

Manually uploading the query suggestion

1. Browse to Central Administration -> Service Applications -> Search Service Application.

2. Go to Queries and Results -> Query Suggestions

3. Select Show Query Suggestions

4. In Always suggest phrases -> Import from text file

5. Browse to Central Administration -> Monitoring -> Review job definitions -> Prepare query suggestions -> Run Now

6. In this example, I start typing for the word “Chicago, all words starting with Chicago is automatically picked up.

Implementing Thesaurus in SharePoint 2013

1. Create a thesaurus file
2. Deploy/Import the Thesaurus file
3. Check the results

1. Create a thesaurus file

- In the Key column, enter the term (single or multiple words) that you want to trigger a synonym for when the term occurs in a query.
- In the Synonym column, enter the synonym (single or multiple words) that you want to add to the query if the term specified in the Key column occurs in a query.
- In the optional Language column, enter the abbreviation for the language for which the synonym should apply.
Example of a thesaurus looks like this:
IE,Internet Explorer
Internet Explorer,IE
UN,United Nations,en
UN,Vereinte Nationen,de

2. Deploy/Import the Thesaurus file

Start the SharePoint 2013 Management Shell.
$searchApp = Get-SPEnterpriseSearchServiceApplication
Import-SPEnterpriseSearchThesaurus -SearchApplication $searchApp -Filename <Path>

<Path> specifies the full UNC path of the .csv file (the thesaurus) to be imported.Universal Naming Convention (UNC) is a way to identify a shared file in a computer without having to specify (or know) the storage device it is on. 

In Windows operating systems, the UNC name format is:

3. Check the results

When you search for "IE" you should get results with "IE" and "Internet Explorer"

SharePoint 2013 Thesaurus or Synonyms