Tuesday 1 December 2015

Everything is fine, but we had a small problem getting your license.SharePoint 2013 Apps

I was try to Add Apps from SharePoint store, but I am unable to add it. I was getting below error message


“Everything is fine, but we had a small problem getting your license. Please go back to the SharePoint Store to get this app again and you won't be charged for it. "




I am using SharePoint 2013 on my local server. I configure everything correctly I rechecked, but nothing is working for me.



Solution:

I was using system account or farm account. Then I use different account for it, it’s working for me.



The System Account cannot be used to get apps from the app store...


Tuesday 3 November 2015

Database is in compatibility range and upgrade is recommended

I had moved the SharePoint content databases from one farm to another recently. After the migration was completed I browsed to Central Adminitration -> Upgrade and Migration -> Review Database Status. The migrated Sharepoint content database had the Status as "Database is in compatibility range and upgrade is recommended".

This indicated I had to manually upgrade these content databases.



This was because I moved the content databases from SharePoint 2010 SP1 to SharePoint 2010 SP2.

This is how it should be solved if I am not wrong:

Test-SPContentDatabase -Name ContentDBName -WebApplication http://webapp/ > c:\result1.txt (to confirm that there are no Upgrade Blocking categories that equal true)

Upgrade-SPContentDatabase -Name ContentDBName (Depending on the size of the database, this process could take long time)



Once completed 100% the database upgrade, browse to Central Administration -> Upgrade and Migration -> Review Database Status. Confirm that the content database now has Status as "No action required".




Thursday 1 October 2015

How to: Change the Distributed Cache Service managed account 2013

When you get the annoying pink marker in CA and one of the issues it warns you about, is that ‘the farm account should not be used for other services’ In my case, the scripted install had set the ‘Distributed Cache Service (Windows Service)’ to use the  farm account as managed account. As the 2013 Central Admin is (or tries to be) helpful, it gives you the direct link to the: ‘Security’ – ‘General Security’ – ‘Configure Service Accounts’ and tells you to change it there.

To fix it, just click the link, find the service in the dropdown and select another Managed account in the lower dropdown. Then click ok…..but nooo…that one wont fly.
Changing the service account on this service cannot be done this way and has to be done using PowerShell…thats what you get back.

Well…after some short researching I found this to work ok: (first load the snapin, add-pssnapin microsoft.sharepoint.powershell)

$farm = Get-SPFarm
$cacheService = $farm.Services | where {$_.Name -eq "AppFabricCachingService"}
$accnt = Get-SPManagedAccount -Identity <domain\user>
$cacheService.ProcessIdentity.CurrentIdentityType = "SpecificUser"
$cacheService.ProcessIdentity.ManagedAccount = $accnt
$cacheService.ProcessIdentity.Update()
$cacheService.ProcessIdentity.Deploy()

(Where <domain\user> is the domain name and user name of the managed account you want to use instead.)

Note: Beware of the doublequotes if you copy the code…

Tuesday 1 September 2015

Fix: Cannot use the special principal ‘sa’. Microsoft SQL Server, Error: 15405

When importing a database in your SQL instance you would find yourself with Cannot use the special principal 'sa'. Microsoft SQL Server, Error: 15405 popping out when setting the sa user as the DBO of the database. To fix this,

Open SQL Management Studio and Click New Query. Type:

USE mydatabase
 exec sp_changedbowner 'sa', 'true'



Wednesday 5 August 2015

Getting more than 30 Days of SharePoint Usage Report Data

One of the clients that I was working with needed some extensibility to the out of the box SharePoint Usage Reports.

The data displayed on the reports didn’t meet their requirements, first, they needed to match the data with the user data in SAP in order to get the reports by Region and other parameters, and second, they needed historical data, and not only the last 30 days of information.

The first requirement was not a problem, and at the beginning we didn’t think the second would be a problem either, but oh we were wrong.

Using the out of the box usage reports provided by SharePoint was of course not even an option, we needed a way to get the data and create our own reports.

I spent some time doing research and this is what I found:
  • Using the Object Model. The SPWeb object contains the method GetUsageData(). This is the method called by the Usage Repor pages in sharePoint. It Returns a table that contains information about the usage of a Web site, based on a time interval. Unfurtunately there are only two options for the time interval, either today or last month. So, no way to get more than 30 days of information using the Object model.
  • Web Services. No web service exposes usage report data, so I thought about using owssvr.dll, but again, you can only get the last 30 days of data.

Usage Report data is stored in log files in the IIS and also in the Shared Services database, and not only for the last 30 days, but for all the time since the usage reports were activated, so how is it possible that SharePoint doesn’t have a way to expose this data? Well, that’s how the world works.

Working directly with the SharePoint Databases is not supported by Microsoft, so it seemed that my only option was to create a program to read the IIS files. Have you taken a look at those files? Well, they are quite a mess and I didn’t want to have to do anything with them. So I consulted one of my closest friends: “Reflector”, and once again he gave me the solution I was looking for :)

I found out that the PortalContext object contains a reference to the Shared Services Database through the property “AnalyticsSqlSession”, using this property you get a connection to the database without having to worry about server name, database name, etc.

Since all the usage data is stored in the Shared Services database this was definitely helpful, but let’s not forget that working directly with the databases is not supported, and although I was not accessing directly the database using SQL server, I was however connecting to it and making some queries (READ ONLY).

We presented our solution to Microsoft, and to our surprise, the solution was accepted because somehow we were using the Object Model to get the data, nice!

Having the solution and Microsoft approval, everything got easier. These are the tables in the database that are related to the usage reports:



As you can see, everything is in there! We can do the queries we want and get the data we are looking for.

Going back to the AnalyticsSqlSession property of the PortalContext object, this is how I got it:




Worked like a charm!

Wednesday 1 July 2015

SharePoint 2010: Create new Search Services with Custom DB names Powershell

When you try to create Search services in SharePoint 2010 using the wizard, it gives you nightmare with the Database names with horrible GUIDs...

here is a simple script to ease your life:

## Parameters used

## change the variables below to your own servers and naming conventions



$databaseServerName = "shrpt-db-server"

$searchServerName = "shrpt-apps-server"

$searchSAName = "Search Service Application"

$saAppPoolName = "SharePoint Web Services Default"

$searchDBName = "Search_Services_Application_DB"



## First remove the old search

## This will require an id - namely a guid so get the service guid before doing this



$spapp = Get-SPServiceApplication -Name $searchSAName

Remove-SPServiceApplication $spapp -RemoveData



##START SEARCH

Write-Host "Creating Search Service and Proxy..."

Write-Host "  Starting Services..."

Start-SPEnterpriseSearchServiceInstance $searchServerName

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $searchServerName



Write-Host "  Creating Search Application..."

$searchApp = New-SPEnterpriseSearchServiceApplication -Name $searchSAName -ApplicationPool $saAppPoolName -DatabaseServer $databaseServerName -DatabaseName $searchDBName

$searchInstance = Get-SPEnterpriseSearchServiceInstance $searchServerName



Write-Host "  Creating Administration Component..."

$searchApp | Get-SPEnterpriseSearchAdministrationComponent | Set-SPEnterpriseSearchAdministrationComponent -SearchServiceInstance $searchInstance



##Crawl



Write-Host "  Creating Crawl Component..."

$InitialCrawlTopology = $searchApp | Get-SPEnterpriseSearchCrawlTopology -Active

$CrawlTopology = $searchApp | New-SPEnterpriseSearchCrawlTopology

$CrawlDatabase = ([array]($searchApp | Get-SPEnterpriseSearchCrawlDatabase))[0]

$CrawlComponent = New-SPEnterpriseSearchCrawlComponent -CrawlTopology $CrawlTopology -CrawlDatabase $CrawlDatabase -SearchServiceInstance $searchInstance

$CrawlTopology | Set-SPEnterpriseSearchCrawlTopology -Active



Write-Host -ForegroundColor white "  Waiting for the old crawl topology to become inactive" -NoNewline

do {write-host -NoNewline .;Start-Sleep 6;} while ($InitialCrawlTopology.State -ne "Inactive")

$InitialCrawlTopology | Remove-SPEnterpriseSearchCrawlTopology -Confirm:$false

Write-Host  



##Query



Write-Host "  Creating Query Component..."

$InitialQueryTopology = $searchApp | Get-SPEnterpriseSearchQueryTopology -Active

$QueryTopology = $searchApp | New-SPEnterpriseSearchQueryTopology -Partitions 1

$IndexPartition= (Get-SPEnterpriseSearchIndexPartition -QueryTopology $QueryTopology)

$QueryComponent = New-SPEnterpriseSearchQuerycomponent -QueryTopology $QueryTopology -IndexPartition $IndexPartition -SearchServiceInstance $searchInstance

$PropertyDatabase = ([array]($searchApp | Get-SPEnterpriseSearchPropertyDatabase))[0]

$IndexPartition | Set-SPEnterpriseSearchIndexPartition -PropertyDatabase $PropertyDatabase

$QueryTopology | Set-SPEnterpriseSearchQueryTopology -Active

## Proxy



Write-Host "  Creating Proxy..."

$searchAppProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name "$searchSAName Proxy" -SearchApplication $searchSAName > $null



#####END SEARCH   

Wednesday 3 June 2015

There was a problem retrieving data for this field. Updating values in this field is disabled temporarily. You can still update values in other fields.

While trying to update user profile of a user in SharePoint 2010 I got this error  "There was a problem retrieving data for this field. Updating values in this field is disabled temporarily. You can still update values in other fields.".





The SharePoint farm was using cross-farm services. The "Managed Metadata Web Service" was shared between the farms. This issue can be resolved by enabling "This service application is the default storage location for Keywords." option for the "Managed Metadata Web Service Proxy".



Wednesday 6 May 2015

SharePoint Excel Serivces Error

So if you have seen this error:

Excel Services:
We're sorry. We ran into a problem completing your request. Please try that again in a few minutes.


Believe me even if you tried again in few minutes it might not work...

Few suggestions:
Check in central admin if your excel services is running.
Check if you have an Excel Service application in your service applications.

In Central Administration



Go to Application Management



And then in Manage Web Application



I select my web site (Share Point - 80) and then select 'Service Connection'



Finally I Checked Excel Service Application And it work for me.




Wednesday 15 April 2015

SharePoint 2010: Remove the My Site Host Location URL





So if you have seen the above screen and wondering if it is ever possible to remove my site host location follow simple power-shell to remove it.

$site = Get-SPSite "http://<url of your admin site>"

$context = Get-SPServiceContext($site)

$upm = New-Object -TypeName Microsoft.Office.Server.UserProfiles.UserProfileManager -ArgumentList $context

$upm.MySiteHostURL="";

Tuesday 3 March 2015

Sharepoint 2010 error opening .pdf files




When you try to open a PDF document from your standard SharePoint library, as it tries to open it in Acrobat viewer and you encounter the error:

There was an error opening this document. The filename, directory name, or volume label syntax is incorrect.

You can fix it read below:

DON'T


  • Change Client Integration
  • Change File handling methods

DO

Go to the following Path:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML

Edit the DOCICON.XML file 

Find this entry

<Mapping Key="pdf" Value="icpdf.png" OpenControl="PdfFile.OpenDocuments"/>




and edit it to 

<Mapping Key="pdf" Value="icpdf.png" OpenControl="SharePoint.OpenDocuments"/>





Hope this fixes your problem


Tuesday 3 February 2015

Using the Developer Dashboard

How to Enable the Developer Dashboard

The Developer Dashboard is always off by default. To make it viewable, you must enable it, by using STSADM, Windows PowerShell cmdlets, or the SharePoint Foundation object model.

Using STSADM
Open a command window to the %ProgramFiles%\Common Files\Microsoft Shared Debug\Web Server Extensions\14\BIN directory and enter one of the following commands, depending on the desired display mode.

Mode (Always On)
stsadm -o setproperty -pn developer-dashboard -pv on

OnDemand
stsadm -o setproperty -pn developer-dashboard -pv ondemand


Using Windows PowerShell Cmdlets
Mode (Always On)
(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = ”On”

OnDemand
(Get-SPFarm).PerformanceMonitor.DeveloperDashboardLevel = ”OnDemand”


How to Disable the Developer Dashboard

Using STSADM
stsadm -o setproperty -pn developer-dashboard -pv off


Thursday 8 January 2015

SharePoint 2010: Site Web Analytics Reports Issue/Error

ISSUE:

You are trying to access “Site Web Analytics Reports” on your site using the below URL

http://<Your_Site_URL>/_layouts/UsageDetails.aspx

But everytime, you try to access the report, you are getting error message, which is mentioned below:

Unexpected failure.

 Troubleshooting Microsoft SharePoint Foundation.

 Correlation ID: 1e9c-4f07-0eb920fa-9311-b353aa6eac13

 Date and Time: 08/15/2012 13:08:05 


RESEARCH:

I checked and found that we can access the report by directly accessing the URL mentioned below
http://<Your_site_URL>/_layouts/WebAnalytics/Report.aspx?t=SummaryReport&l=s

When i browse the above url, i get below message:

This report displays all available metrics Web Analytics for the specified date range, and the tendency to change the date range above. This requires that the new SharePoint user experience is on. A site owner or administrator can enable the new experience from the Site Actions menu option or from the title, description and appearance of Site Settings.

RESOLUTION:

This is the new feature made available in SharePoint 2010, hence the Visual upgrade of site is a must to work this. Which means the current look n feel of 2007 need to be upgrade to 2010. Once this is performed the site display will change many things and remove any kind of custom work on the site.