Showing posts with label Sharepoint 2010. Show all posts
Showing posts with label Sharepoint 2010. Show all posts

Saturday, March 14, 2015

Get all the site collection with content DB details using powershell commands

As discussed earlier power shell commands are pretty powerful than SharePoint object model code. Some time we can't run SharePoint object model code in production environment like gathering site/server/DB details.

We can get sites and content DB details using following power shell commands 


$rootSite=New-Object Microsoft.SharePoint.SPSite("Web app URL")
$spWebApp = $rootSite.WebApplication 
foreach($site in $spWebApp.Sites) {
    
    write-output "$($site.RootWeb.Url) - $($site.ContentDatabase)"     
  
    $site.Dispose() 


Wednesday, March 11, 2015

Create explicit managed path for host named site collection using PowerShell commands

In SharePoint 2013, host-named site collections (HNSC) are all the rage. Host-named site collections give you the ability to provide completely different URLs for a site collection regardless of the web application URL hosting it.  For example, you might have a web application URL named http://sharepoint.mycompany.com and under it you have a collaboration site with a URL of http://collaborate.mycompany.com and an Intranet site namedhttp://intranet.mycompany.com.  This allows you to host multiple types of SharePoint sites together on a single web application which ultimately reduces the amount of resources your server farm needs for application pools.

Just like any site collection, you have to create a managed path for the URL you want.  We do this using New-SPManagedPath.  We can add explicit or wildcard inclusions just like you can for path-based site collections.  Wildcard is the default, if you want explicit, include the –explicit parameter.  We also need to add the –HostHeader parameter to indicate this is used with host-named site collections.  Here’s an example, where I created the business-solutions explicit path from our example above.

New-SPManagedPath "managed path name" -HostHeader –Explicit

This technically makes this managed path available on any host-named site collection.  If you want to see what managed paths have been created for host-named site collections, use Get-SPManagedPath with the –HostHeader command.

Get-SPManagedPath –HostHeader

Now, we need to create the site collection using New-SPSite.  It takes a few parameters but the important ones for this scenario is the URL we want for the new site collection and then –HostHeaderWebApplication to specify which web application hosts the new site collection.

New-SPSite “Site collection URL” –HostHeaderWebApplication “host web app URL” -Name "Site collection name" -OwnerAlias domain\user  -Template STS#0


SharePoint 2010 site accessing error - The server is busy now. Try again later

While accessing ee.ihess.com (SharePoint 2010) site, I got the error saying that “The server is busy now. Try again later” as shown the image below.


We can get this error when on the processes/services taking up the bulk of your server resources you can take different actions to reduce this overload (For example: recycling the timer service more often). We have the option to turn off HTTP throttling for an entire web application in Central Administration.
We can fix this error by using the steps below
  • Navigate to Central Admin > Application Management > Manage Web Applications. 
  • Select the problematic Web App > Select the down arrow next to General Settings and click Resource Throttling.

  • On the bottom of the window there will be an option to turn HTTP Request monitoring and Throttling Off. Click OK to save changes.



Sunday, December 14, 2014

SharePoint deployment – Back to basics – WSP stuck on “Deploying” state

While deploying a WSP in one of my SharePoint 2010 project, wsp stuck on “Deploying” state. I am Deploying the solution with farm admin credentials using Central Administration globally. But the status was “Deploying” for long time.

I have spent almost 2 hours on that but still the state is on “Deploying”. By verifying the few blog posts on the same error by running all the administration service jobs using stsadm.exe – o execadmsvcjobs issue may fixed.



I ran the command but still the Deployment status showing “Deploying”. I have restarted OWS Timer Service on all the servers in the farm. Finally all the Deployments ran successfully. 

Saturday, October 4, 2014

SharePoint 2010 workflow error – “Due to heavy load, the latest workflow operation has been queued”

While working with custom workflows in SharePoint 2010, I got error in workflow as “Due to heavy load, the latest workflow operation has been queued”. After refreshing the page, most of the times error may fixed and workflow completed as usual. Sometimes I used to stuck on the workflow and I can see only the non-reactive screen with the error. I didn’t event fix the error after resetting the workflow and IIS Manager. After digging for the solution finally I got a fix for the error by updating the Workflow Postpone threshold in farm config manager by using following PowerShell commands,

Set-SpFarmConfig -WorkflowPostponeThreshold 30

By running the command, workflow threshold will be increased from 15 to 30

get-sptimerjob | ?{$_.name -like "job-workflow"} | set-sptimerjob -schedule "every 1 minutes between 0 and 59"



By running this command frequency of execution for SP timer job, job-workflow will be increased to every minute. After running the commands, if workflow don’t have any issues will be completed as expected.

Tuesday, September 30, 2014

SharePoint Restore-SPSite error - Response message does not match the content type of the binding

While working with SharePoint site  restoring with PowerShell commands I got an error saying that, 

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

After googling some time I got the cause and fix for the solution. In my case in my current secured store service web application web.config file we have some duplicate nodes for forms based configuration.

To fix that we need to follow the steps below,
  • Open SharePoint server form and open IIS manager.
  • Open SharePoint Security Token Service Application and Explore the web application details for web.config file.
  • In the web.config file verify the duplicate nodes and check all the nodes are allocated properly in the web.config file. In my current scenario we got extra node in forms based authentication configuaration. I have removed the duplicate node and restored the site.


Now I am able to restore the site. Hope this will helps.