Wednesday, March 28, 2012

An error has occurred. Please try again later- while opening the Excel File in the SharePoint Browser

Today I found  one more error while opening the excel sheet.
 i.e.  Error: An error has occurred. Please try again later
 
And  this error will come only once when we open the excel in the first time only, if we try after that we won’t get the same error message but SharePoint event viewer Application and ULS will log the error as below every time after opening the excel file.
 
There was an error in communicating with Excel Calculation Services http://server /ExcelService*.asmx exception: An error has occurred.[Session: User: SHAREPOINT\system]”
 
 
 SharePoint event viewer application and ULS logs:
 
Error 1:  There was an error in communicating with Excel Calculation Services http://server /ExcelService*.asmx exception: An error has occurred.[Session: User: SHAREPOINT\system]
Event ID: 5240
 
Plan A:
 
Verified the following services and are running correctly:
 
Excel Services are started and running fine.
 
Need to reboot the server.
 
 
Plan B:
 
Delete the existing excel service application and need to create the new one and associate the same to the appropriate web apps.
 
Plan C:
 
Verify the Current SharePoint Version and if it is not up to date then  requires a latest service Pack1.
 
 
Error: Excel Services --The user receives the "An Error Has Occurred" message on the server when the TREND, LINEST, LOGEST, or GROWTH are used with external references on the Excel client and then the file is uploaded to the server.
 
Need to execute the plans and will have to cross verify logs .

Thursday, March 22, 2012

SharePoint2010 warmup Scripts

Recently I got a requirement  on SharePoint 2010 warmup scripts.This is one of the good article which I found from google, will do the warm up for  SharePoint 2010 sites and their Cache.


 Reference: http://ikarstein.wordpress.com/2011/08/03/sharepoint-warm-up-now-with-timeout/

 #############################################
# Title: Warmup-SPSites.ps1       
# Author: Ingo Karstein: http://ikarstein.wordpress.com/2011/08/03/sharepoint-warm-up-now-with-timeout/                       
#############################################

#Region Define Variables
### Setup your variables here
$timeout = 60000 #=60 seconds
# Leave the line below commented if you want all of the Web Apps. Uncomment and set for only specific ones.
#$urls= @("http://finweb", "http://another.sharepoint.local")
#EndRegion

#Region Load SharePoint Snapin
$ver = $host | select version
if ($ver.Version.Major -gt 1)  {$Host.Runspace.ThreadOptions = "ReuseThread"}
Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#EndRegion


#Region MyWebClient
    Add-Type -ReferencedAssemblies "System.Net" -TypeDefinition @"
    using System.Net;
    public class MyWebClient : WebClient
    {
        private int timeout = 60000;
         public MyWebClient(int timeout)
        {
            this.timeout = timeout;
        }
         public int Timeout
        {
            get
            {
                return timeout;
            }
            set
            {
                timeout = value;
            }
        }
         protected override WebRequest GetWebRequest(System.Uri webUrl)
        {
            WebRequest retVal = base.GetWebRequest(webUrl);
            retVal.Timeout = this.timeout;
            return retVal;
        }
    }
"@
#EndRegion

#Region Function to get Site List
Function Get-SiteList {
$script:sitelist = "$env:temp\siteURLs.txt"
New-Item $script:sitelist -itemType File -Force | Out-Null
# To WarmUp, we really just need the load the Web Apps
#$sites = Get-SPWebApplication -IncludeCentralAdministration | Select Url
# If we want to try some caching too, get all the site collections, comment above and uncomment below
$sites=Get-SPSite -Limit ALL
foreach ($site in $sites)
    {
        #write-host $site.Url;
        $site.Url | Out-File $script:sitelist -append
    }
}
#EndRegion

#Region Set URLs to WarmUp
# check to see if a variable $urls is set.
if (!(test-path variable:\urls))
    {
    Get-SiteList
    $urls = (Get-Content $script:sitelist)
    }
#EndRegion

#Region Perform the WarmUp
New-EventLog -LogName "Application" -Source "SharePoint Warmup Script" -ErrorAction SilentlyContinue | Out-Null

$urls | % {
    $url = $_
    Write-Host "Warming up $_"
    try {
        $wc = New-Object MyWebClient($timeout)
        $wc.Credentials = [System.Net.CredentialCache]::DefaultCredentials
        $ret = $wc.DownloadString($url)
        if( $ret.Length -gt 0 ) {
            $s = "Last run successful for url ""$($url)"": $([DateTime]::Now.ToString('yyyy.dd.MM HH:mm:ss'))"
            $filename=((Split-Path ($MyInvocation.MyCommand.Path))+"\SPWarmUp.log")
            if( Test-Path $filename -PathType Leaf ) {
                $c = Get-Content $filename
                $cl = $c -split '`n'
                $s = ((@($s) + $cl) | select -First 200)
            }
            Out-File -InputObject ($s -join "`r`n") -FilePath $filename
        }
    } catch {
          Write-EventLog -Source "SharePoint Warmup Script"  -Category 0 -ComputerName "." -EntryType Error -LogName "Application" `
            -Message "SharePoint Warmup failed for url ""$($url)""." -EventId 1001

        $s = "Last run failed for url ""$($url)"": $([DateTime]::Now.ToString('yyyy.dd.MM HH:mm:ss')) : $($_.Exception.Message)"
        $filename=((Split-Path ($MyInvocation.MyCommand.Path))+"\lastrunlog.txt")
        if( Test-Path $filename -PathType Leaf ) {
          $c = Get-Content $filename
          $cl = $c -split '`n'
          $s = ((@($s) + $cl) | select -First 200)
        }
        Out-File -InputObject ($s -join "`r`n") -FilePath $filename
    }
}
#EndRegion

$script:sitelist | Remove-Item -force -ErrorAction SilentlyContinue

Monday, March 19, 2012

issue with word docs opening in browser in SharePoint 2010 Portal


Issue: 
Word Web App cannot open this document for viewing because of an unexpected error.
To view this document, open it in Microsoft Word.
Error Id: eaface98-06b3-4fcc-9113-405f206b8d71, 20120316145832 

Resolution:
I verified the list of the service applications details and services that are running in the farm.
Found that Word Viewing Service Application is not started .I started the service and the word document started rendering in the browser.




Wednesday, March 14, 2012

Service Accounts and Managed Accounts in SharePoint 2010


Following errors generated in the SharePoint Health analyzer,

Error 1 : The server farm account should not be used for other services.
NA\prodspinstall, the account used for the SharePoint timer service and the central administration site, is highly privileged and should not be used for any other services on any machines in the
server farm. 
The following services were found to use this account:
SAM - 80 (Application Pool) ,SharePoint - 8001 (Application Pool) ,SharePoint - 8080 (Application Pool) ,SharePoint - BPSMERFWWF.pxl.int (Application Pool),SharePoint - TelePresence.pxl.int (Application Pool) ,OSearch14(Windows Service) ,Web Analytics Data Processing Service(Windows Service) ,
Remedy: Browse to /_admin/FarmCredentialManagement.aspx and change the account used for the services listed in the explanation. For more information about this rule, see "http://go.microsoft.com/fwlink/?LinkID=142685".
These are the following  are basic accounts we need to configure for SharePoint2010 Env .
SharePoint Installation Account, SharePoint Farm Account, Service Applications Account, Content Web Application App Pool Account, UPS Sync Account(User Profiles),My Site Host Web Application App Pool Account
Managed Service Accounts:
  • All Service Application Pool Accounts
    • Access Service Application
    • BCS Service Application
    • Excel Services Service Application
    • Metadata Service Application
    • PerformancePoint Service Application
    • Enterprise Search Service Application
    • Secure Store Service Application
    • Subscription Settings Service Application
    • User Profile Service Application
    • Visio Services Service Application
    • Web Analytics Service Application
    • Word Automation Service Application
    • Word Viewing Service Application
    • PowerPoint Viewing Service Application
    • Security Token Service Application
  • All Content Web Application Pools
  • Service Instances
    • Claims to Windows Token Service
    • Document Conversion Launcher Service
    • Document Conversion Load Balancer Service
    • Microsoft SharePoint Foundation Sandboxed Code Service
    • SharePoint Foundation Help Search
    • SharePoint Server Search (Enterprise Search)
    • Web Analytics Data Processing Service
Service Accounts (should not be managed):
  • Search Crawl Accounts
    • For Foundation Search and Server (Enterprise) Search
  • Unattended User Accounts
    • Excel Services Service Application
    • Visio Services Service Application
    • PerformancePoint Service Application
    • (in general, any Secure Store application credentials)
  • Object Cache Portal Accounts
    • Super User Account
    • Super Reader Account
  • User Profile
    • Synchronization Service Account (listed incorrectly on the FarmCredentialManagement.aspx page)
    • Synchronization Connection Account
  • Server Search Custom Crawl Rule Accounts
    • Any crawl rule that specifies an account other than the default crawl account
Please find the list of Service Accounts and their purpose details as below:
Account
Purpose
Domain Rights
Local Admin Rights
SQL Server Rights
What Happens behind the screen?
SharePoint Installation Account(e.g. sp_install)
Install the SharePoint binaries using the SharePoint Setup Program. Run the SharePoint Product Configuration Wizard.
Performs post-installation updates, patches, and installation of products such as language packs.
Will provision the server farm account during the SharePoint product config wizard.
Must be Domain User Account. Local User Accounts are not supported.
Member of Local Administrators Group on each server where SharePoint Installer would run (aka. WFE and Application Servers, excluding SQL Server or SMTP Server).
SQL Server Login on the database server. Needs access to the SQL Server where SharePoint 2010 databases will run.Member of following SQL Server Security Roles – SecurityAdmin fixed server role and dbcreator fixed server role. SharePoint setup and psconfig.exe requires these privileges to create databases and to create SQL logins for SharePoint accounts.
Not required during installation but may be required for patching (needs to confirm!!) – Member of the db_owner fixed database role, if you are running powershell cmdlets that would affect the database. In reality, installation account requires the SharePoint_Shell_Access database role for any database that you want to create or modify using Windows PowerShell.  This role is currently equivalent to dbowner, but is a separate role.

After you run the configuration wizards, machine-level permissions for this account are added:
  • Membership in the WSS_ADMIN_WPG Windows security group.
After you run the configuration wizards, database permissions are added:
  • DB_OWNER on the SharePoint Server 2010 server farm configuration database.
  • DB_OWNER on the SharePoint Server 2010 Central Administration content database.
  • Never have access to the Service Application Databases or Web Application Content Databases
Configures the SharePoint 2010 Timer Service (SPTimerV4) to run under farm (sp_farm) account
Configures the SharePoint Admin Windows Service (SPAdminV4) to run under Local System user
Configures the SharePoint VSS Writer (SPWriterV4) to run under Local System user
Configures the SharePoint Tracing Service (SPTraceV4) under Local Service user
SharePoint Farm Account(e.g. sp_farm)
This account is automatically configured during the SharePoint Configuration Wizard.Also known as Database Access Account for the SharePoint_Config  database on the SharePoint Configuration Wizard.
Used for Configure and Manage the SharePoint Farm. Becomes the owner of the farm. In other words, its configured as a dbowner of the SharePoint Config database.
Act as an application pool identity for the SharePoint Central Admin.
Runs the SharePoint Foundation Timer Service (SPTimerV4).
Preferred to use this account to run the User Profile Sync Service.
Using this account, you can add additional farm administrators from the central administration site.
Can be local user account or domain user account.Must be domain account if SQL Server is hosted on another server.
Although it is not required for full time term, farm account should be Member of Local Administrators Group on each server where SharePoint Installer would run (aka. WFE and Application Servers, excluding SQL Server or SMTP Server). It will provide ease of access for the SharePoint Admins.Must be on the Member of Local Administrators Group on the server during UPS Service provisioning process.

 None
This account will be registered as Managed Service Account in the Central Administration.After you run the configuration wizards, Additional permissions are automatically granted to the server farm account on Web servers and application servers that are joined to a server farm.
  • Membership in the WSS_ADMIN_WPG Windows security group for the SharePoint Foundation 2010 Timer service.
  • Membership in WSS_RESTRICTED_WPG for the Central Administration and Timer service application pools.
  • Membership in WSS_WPG for the Central Administration application pool.
  • Member in the built-in IIS_IUSRS on IIS 7 (Windows Server 2008) and IIS 7.5 (Windows Server 2008 R2), IIS_IUSRs replaces earlier version IIS_WPG built-in group
After you run the configuration wizards, SQL Server and database permissions for sp_farm includes:
  • Added as SQL Server Login to DB Server
  • Added as DBCREATOR fixed server role because when you create new web applications and content databases, Central Administration’s application pool identity (sp_farm) has to be able to create those databases on the SQL server.
  • Added as SECURITYADMIN fixed server role because Central Admin can create SQL Server logins when you create managed accounts or modify app pool identities.  Each web application pool’s identity must have a login for that web application’s content databases.
  • Added as a DB_OWNER fixed database role for all the SharePoint databases (e.g. configuration databases, service application databases, or content databases) on the farm.
  • Added as a WSS_CONTENT_APPLICATION_POOLS and SHAREPOINT_SHELL_ACCESS fixed database roles for the SharePoint Server 2010 server SharePoint_Config and SharePoint_AdminContent databases.
Service Applications Account(e.g. sp_serviceapps)
Application Pool identity to run the majority of the all the SharePoint 2010 Service Applications (WCF endpoint) as the IIS  worker process (e.g. Managed Metadata Service and/or User Profile Service).Please note that both Service Application App Pool and Web Application App Pool behaves same.
You can create more than 1 service account to isolate the IIS processes under services will run.
Must be Domain User Account.Must register as SharePoint Managed Account.
None
None

After you create the SharePoint Service Application, following machine-level permission is configured automatically:
  • Member in the WSS_WPG
  • Member in the built-in IIS_IUSRS on IIS 7 (Windows Server 2008) and IIS 7.5 (Windows Server 2008 R2), IIS_IUSRs replaces earlier version built-in group, IIS_WPG
After you create the SharePoint Service Application, following SQL Server and database permissions for this account are configured automatically:
  • This account will be assigned to the db_owner role for the service application content databases (e.g. Managed Metadata, User Profile DBs etc.)
  • Never have access to the associated web application content databases.
  • This account is assigned to the WSS_CONTENT_APPLICATION_POOLS role associated with the farm configuration database.
  • This account is assigned to the WSS_CONTENT_APPLICATION_POOLS role associated with the SharePoint_Admin content database.
Content Web Application App Pool Account(e.g. sp_defaultwebapp)
Application Pool identity to run the IIS Site hosting the SharePoint Content Web Applications and SharePoint Site Collections as the IIS  worker process.Please note that both Service Application App Pool and Web Application App Pool behaves same
It is best practice to run all the content web applications in their dedicated application pool account.

Must be Domain User Account. Must register as SharePoint Managed Account.

 None
 None
After you create the SharePoint Web Application, following machine-level permission is configured automatically:
  • Member in the WSS_WPG
  • Member in the built-in IIS_IUSRS on IIS 7 (Windows Server 2008) and IIS 7.5 (Windows Server 2008 R2), IIS_IUSRs replaces earlier version built-in group, IIS_WPG
After you create the SharePoint Web Application, following SQL Server and database permissions for this account are configured automatically:
  • This account is assigned to the db_owner role for the Web application content databases.
  • This account is assigned to the WSS_CONTENT_APPLICATION_POOLS role associated with the farm configuration database.
  • This account is assigned to the WSS_CONTENT_APPLICATION_POOLS role associated with the SharePoint_Admin content database.
  • This account will be assigned to the db_owner role for the associated user profile service application databases (e.g. Profile DB, Sync DB, and Social DB)
UPS Sync Account(e.g. sp_ups)
Perform the User Profile Sync. FIM uses this account to import the AD profiles. Specify on the Synchronization Connection on the User Profile Service Administration Page.
Domain User Account with Replicating Directory Changes Permission. No need to register as SharePoint Managed Account.
None
None
 None
My Site Host Web Application App Pool Account(e.g. sp_mysiteapp)
Application Pool identity to run the IIS Site hosting the My Sites Web Applications and User Personal Sites as the IIS  worker process.
Must be Domain User Account.Must not be a member of the farm administrators group.
 None
 None
After you create the My Site Host, machine-level permission is configured automatically
  • Member in the WSS_WPG
  • Member in the built-in IIS_IUSRS on IIS 7 (Windows Server 2008) and IIS 7.5 (Windows Server 2008 R2), IIS_IUSRs replaces earlier version built-in group, IIS_WPG
After you create the My Site Host, SQL Server and database permissions are configured automatically:
  • This account is assigned to the db_owner role for the My Site Host Web application content databases.
  • App Pool account is assigned to the WSS_CONTENT_APPLICATION_POOLS role associated with the farm configuration database.
  • App Pool account is assigned to the WSS_CONTENT_APPLICATION_POOLS role associated with the SharePoint_Admin content database.
  • This account will be assigned to the db_owner role for the associated user profile service application databases (e.g. Profile DB, Sync DB, and Social DB)

Monday, March 12, 2012

PowerShell Solution Deployment Process



Central Admin
Site/Web Level Features
GAC
Web.
Config
14-Root Features
SharePoint Config DB, Objects Table – Solutions
SharePoint Config DB, Objects Table – Features
Web App Content DB, Features Table
Add-
SPSolution
Solution Added but Not Deployed
N/A
N/A
N/A
N/A
Yes – Solution Definition Added
N/A
N/A
Install-SPSolution
Deployed to Web App
Installed Feature
Yes – DLLs Added
Yes – 
Safe 
Control Entries Added
Yes – Features Added
Yes – Solution Definition Still Exists
Yes – Feature Definition Added
N/A
Enable-SPFeature
Solution Still Deployed
Activated feature to Site/Web
Yes – Still Exists
Yes – Still Exists
Yes – Still Exists
Yes – Solution Definition Still Exists
Yes – Feature Definition 
Still Exists
YES – Feature Activation Link Added
Disable-SPFeature
Solution Still Deployed
Deactivated feature from Site/Web
Yes – Still Exists
Yes – Still Exists
Yes – Still Exists
Yes – Solution Definition Still Exists
Yes – Feature Definition 
Still Exists
NO – Feature Activation Link Deleted
UnInstall-SPFeature
Solution Still Deployed
Uninstalled feature
Yes – Still Exists
Yes – Still Exists
Yes – Still Exists
Yes – Solution Definition Still Exists
No – 
Feature Definition Deleted
N/A
UnInstall-SPSolution
Retracted from Web App
Uninstalled feature
No – DLLs Deleted
No – Safe Control Entries Deleted
No – Features Deleted
Yes – Solution Definition Still Exists
No – 
Feature Definition Deleted
N/A
Remove-SPSolution
Solution Deleted
N/A
N/A
N/A
N/A
Yes – Solution Definition Deleted
N/A
N/A