How to handle – The remote server returned an error: (403) Forbidden while connecting to SharePoint Online (O365)

Recently while working on SharePoint, I found when I try to connect to SharePoint Online from console application using CSOM and try authenticating using default network credential, I got 403 forbidden. After looking bit into it, I realized it is because of the approach I was using to authenticate against the SharePoint Online. In case…

0

Sorry, something went wrong in content by search web part for some users.

Recently I used content by search web part in SharePoint 2013. Web part was working perfectly fine for all the site collection administrators. However when any other user was browsing the page, they were getting “Sorry, something went wrong”. After analysing all the queries and permission, I found that display templates I had uploaded did not have…

2

Creating web part page using client object model (CSOM) in SharePoint 2013 or 2010

It is common scenario to create web part page and there are many ways to do that. In this post, I will give steps to create the web part page programmatically using client object model. First we need to ensure the target destination for the page we are creating. In this example I will create…

3

Error "Cannot complete this action.", while accessing term set collection object using Group.TermSets

If you are getting error saying “cannot complete this action.”, while accessing term set collection object using Group.TermSets with stack trace similar to   at Microsoft.SharePoint.SPGlobal.HandleComException(COMExceptioncomEx)     at Microsoft.SharePoint.Library.SPRequest.CalculatePermissionsForCurrentThread(Object&pvarAcl, Boolean bOnlyAces, UInt64& pPermGrant, UInt64& pPermDeny,Boolean& pbIsSiteAdmin, Boolean&pbIsSiteAuditor)     at Microsoft.SharePoint.Administration.SPAcl`1.CalculatePermissions()    at Microsoft.SharePoint.Administration.SPAcl`1.EffectivePermissions()    at Microsoft.SharePoint.Taxonomy.TermStore.GetEffectiveRights(SPAcl`1 acl, GuidgroupId)     at Microsoft.SharePoint.Taxonomy.TermStore.GetEffectiveRights(SPAcl`1 acl, GuidgroupId)     at Microsoft.SharePoint.Taxonomy.Internal.Security.CanUserSeeTermSet(TermSet termSet)     at Microsoft.SharePoint.Taxonomy.TermSet.TryCreateTermSet(SharedTermSetsharedTermSet, TermStore termStore)     at Microsoft.SharePoint.Taxonomy.TermSetCollection.CreateTermSetCollection(List`1sharedTermSets,…

0

ActiveX control cannot be instantiated because the current thread is not in a single-threaded apartment.

If you are getting error saying “ActiveX control cannot be instantiated because the current thread is not in a single-threaded apartment.” then you need to apply STAThreadAttribute attribute to the entry point method. Ex –         [STAThread]        static void Main(string[] args)        {          } This attribute indicates that the COM threading model for an application is…

0

File or arguments not valid for site template while creating SharePoint 2013 site collection using SharePoint 2010 site template

If you are trying to create site collection in SharePoint 2013 using SharePoint 2010 site template, then you need to provide CompatibilityLevel in New-SPSite cmdlet. CompatibilityLevel  specifies the version of site template to use when creating the site collection using New-SPSite. The values for CompatibilityLevel  can be either 14 for SharePoint Server 2010 experience sites…

0