Archive

Author Archive

SharePoint never say “It won’t take long”

June 29, 2012 2 comments

SharePoint – why is nothing ever quick ?

Recently I had to help out a client who was trying to restore a single piece of content  from a backup. We had a backup copy of the content-db and the client also had a recovery farm we could use, so this shouldn’t have taken long.

The backup was over 200 GB, so the 1st problem was to find enough space on the DR farm to recover the content db, once we had enough space the backup was restored to SQL and we attached the content db to the recovery farm, but the Current Number of Sites, was 0, very odd…

I ran a couple of SQL queries on the content db to get some information about its content,

http://devdotnotes.wordpress.com/2012/01/27/common-sql-queries-for-sharepoint-content-database/

but SharePoint refused to show me any content, so we detached and reattached, moved to another Web-app and reattached but nothing appeared, and no errors were reported from the UI.

I took a look a the ULS logs, which was showing nothing, just the headings. An IIS reset and restart of the Tracing service kicked the ULS logs into action and we tried the reattach again, now we were getting errors in the ULS log.

 

The site named <Site Collection Name> and with id bc229270-86b6-4606-832e-a38c0e71058d was found in the content database <database name> in the database server <SQL Server Name>.  However, the following error was reported while adding a mapping to this site to the configuration database.  Operation is not valid due to the current state of the object. 

Followed by

System.Data.SqlClient.SqlException: Violation of PRIMARY KEY constraint ‘PK_SiteMap’. Cannot insert duplicate key in object ‘dbo.SiteMap’. The statement has been terminated

 

This DR farm had all sorts of other Web Apps and content db’s attached, but I finally worked that another copy of the same db with a different name as attached to one of the other Web Apps, once that was detached we could attach our db, find the site, get the content out and make the client and end user happy Smile

Another day in the wonderful  world of SharePoint !

Categories: MOSS, SharePoint Tags:

Help – SharePoint is throttling me !

June 22, 2012 1 comment

Recently we have been working on a SharePoint 2007 to 2010 upgrade project, the title of this blog article is not quite the error we got from the user, but it wasn’t far off !

image

As part of the upgrade process we connected the 2007 content DB’s to the 2010 farm, and found some very large lists that were hitting the List View Threshold (LVT), which is part of the Resource Throttling settings in 2010 Central Administration.

image

image

30.000,000 items per list is the limit in 2010 http://technet.microsoft.com/en-us/library/cc262787#ListLibrary but 5000 is the LVT for best performance.

Some excellent materials about dealing with large lists are

http://technet.microsoft.com/en-us/library/cc262813.aspx and http://blogs.msdn.com/b/dinaayoub/archive/2010/04/22/sharepoint-2010-how-to-change-the-list-view-threshold.aspx

 

As for our problem, we decided to create some indexed columns and new views on the list to reduce the number of items coming back.

Happy SharePointing !

Categories: SharePoint 2010 Tags:

SharePoint Page Performance

June 18, 2012 1 comment

Recently I have been asked to take a look a couple of client SharePoint systems that have been experiencing a few random performance issues with the odd slow page load times. So I thought I would highlight a few tools that can be used to help with this.

Task Manager

The first and most simple tool to use is Task Manager, run this on your servers to monitor general CPU and memory usage also drill down into individual process memory and CPU usage, if you show processes from all user, you will be able see the w3wp.exe processes and user names (Managed accounts) running those processes. This can help you in a multi-server, multi-web environment, where an app pool on a single server may not have started.

From a command line run c:\Windows\System32\Inetsrv\appcmd list WP to see the app pools currently running, each of these will have a PID.

image

If you add the PID column in task manager you can tie both together and  see what’s going on with your app pools on each server.

image

Developer Dashboard

The developer dashboard is a real bonus in SP2010 for looking at page load issues, run it in ‘OnDemand’ mode, and use the icon next to your name to view the output.

 

image

This will tell you everything about your page execution time

image

to enable the developer-dashboard run

Stsadm –o setproperty –pn developer-dashboard –pv “OnDemand”

An excellent article about the developer dashboard is here

Output Cache

SharePoint server can use the ASP.NET output cache, which can help can help improve page response times by caching ASPX pages in memory, this only works for Publishing pages, use Site Collection Administration settings to get to the Output cache settings page.

 

image

 

Once you have enabled the cache switch on “Enable debug cache information on pages” this will add an extra comment at the end of the HTML markup of a web page indicating if the cache has been used.

<!– Rendered using cache profile:Extranet (Published Site) at: 2012-06-07T12:11:42 –>

or not used

<!– 8 Output cache not used. Reason: User can view an unpublished version of the current page. –>

 

Object Cache

Enabled by default at 100 MB, you can make this larger but remember your memory allocations !

Blob Cache

This is probably the most over looked, but most useful cache available in SharePoint

The BlobCache this is disabled by default, but it allows files and images to be stored in a folder on your WFE server rather then being fetched from the SQL Server for each request.

This is of particular value for large image and movie files, to enable the BlobCache pick a non-system drive on your WFE for your store, then locate the line below in the web.config for the Web App in question and update the drive location and set the enabled value to true

<BlobCache location="C:\BlobCache\14" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="false" />

Don’t forget to backup your web.config before making changes as it a quick way to break SharePoint, also no need for an IIS reset as SharePoint will re-read the web.config as soon as its saved.

 

for more information about SharePoint caching, see the white paper at this location.

http://www.microsoft.com/en-us/download/details.aspx?id=12768

Happy SharePointing !

Categories: SharePoint 2010, SP2010 Tags:

Take control of your log files

June 9, 2012 3 comments

Everyone knows about SharePoint’s ULS logs, these are written by the SharePoint tracing service.

image

To the location set in Central Admin –> Monitoring –> Configure Diagnostic logging 

image

image

You also have a couple of options to control the number of logs created and /or the amount of space used making SharePoint log space friendly, you should be writing the logs to a non-system drive.

But what about IIS ?  In IIS logging can either be on or off, and you can change their location, but that’s about it.

From the IIS console select Logging and open the feature

image

From here you can set the location for the IIS logs, a location set here will be used for all the sites on the server, and it should be on a non-system drive.

image

The IIS log location will look something like this, with a number of sub-folders, one for each web application.

image

the folder names (after the W3SVC) will tally with web site id shown in IIS

image

each folder will contain a number if log files, normally one created per day.

image

This folder names will be the same on all your servers as the site ids are replicated, the only problem with this is that the IIS logs never get cleaned-up. To help address this I have written a quick PowerShell script, that will delete log files over 30 days old.

 

# PS script used to delete IIS logs from sub folders
# set the location to start from
# $location = "D:\logs\iis" use the lines below to read in a location from the command line
$location = $args[0]
if (! $location)
{$location= Read-Host "Enter location to cleanup"}
# get a reference to each file from each subfolder by using the -recursive switch.
foreach ($File in get-childitem $location -Recurse -Include *.log)
# check the lastwrite time and delete if necessary
{if ($File.LastWriteTime -lt (Get-Date).AddDays(-30))
     {del $File}}

The location can either be set in the script or read in when you run it, the –Recuse argument causes Get-Child item to walk through nested folders, with the –Include argument putting a filter on log files, with the –30 value specifying how old a file has to be in days to be deleted.

This can wrapped in a simple batch file and called from a weekly scheduled task to keep your IIS files under control.

Categories: SP2010 Tags: , ,

Forefront 2010 Protection for SharePoint

May 28, 2012 2 comments

Recently I have looking at some performance issues relating to Forefront 2010 Protection for SharePoint (FPSP).

Most people will be be familiar with Forefront Endpoint Protection (FEP) for Windows clients and servers, but with FPSP installed on your SharePoint servers you can benefit from the following features.

  • Stops malware more effectively through integration of multiple industry-leading scanning engines
  • Blocks dangerous attachments from being posted or downloaded with file filtering
  • Prevents the upload or download of out-of-policy content with keyword filtering

In essence FPSP sits in-between your SharePoint service and its content and can scan content on upload and download, and this can can have an impact on both server performance and content upload and download times, it does this by installing its own API (VSAPI) ISAPI filter into IIS.

Another thing to be aware of is that the service account used by FPSP has some specific permission needs

1) Member of local Admins on each SharePoint server

2) Member of Farm Administrators

3) Member of the SQL Sysadmin role on the database server.

Watch out for number 3 as your DBA’s might have something to say.

By default FPSP installs with 4 scanning processes (this can be changed).

image

The scanning process show up in Task manager as FSCRealtimeScanner.exe, and they can consume quite a lot of memory.

image

 

and by default SharePoint will create 10 AntiVirus threads (again this can be changed) for each w3wp process SharePoint creates.

image

So if SharePoint is using 3 W3wp processes there will by default  be 30 threads of execution served by 4 in memory processes, so you may need to play with these numbers to if you are seeing some performance issues.

 

Also don’t forget to add the appropriate folder exclusions in FEP for your SharePoint servers. If your using using SCCM to control FEP policies the following exclusions will be added automatically.

clip_image002

These are okay for a standard SharePoint 2007 or 2010 install, but if your install uses other locations don’t forget to add these.

A full list of location exclusions please see this article

Create a New MySite Host Site

May 9, 2012 3 comments

On a recent project we created a small SharePoint development farm using AutoSPInstaller.

The farm created perfectly, the Portal was working, UPS was working, mysites were working, all was good.

The My Site host Web app had been created on port 8080 with the URL http://ServerName/:8080/

We then decided to move this to a DNS addressable location with a (slightly)  more user friendly URL of

http://DevMySite.domain.local on port 80

I looked at extending the mysite host Web Application, but I decided to create new Web Application with a host header value instead.

The first step is to create a new Web Application with the appropriate value in the Host Header field

image

Make sure your Public URL is the same as the DNS A record

image

For this install I’m using an Alias for SQL, I like to add the word ‘Alias’ just to remind you in 6 months time how you built a system.

image

I’m also creating another content database, but if you have personal sites in an existing content DB, we can deal with that as well.

Now that our new web application has been created on port 80..

image

…we need to put in a root site collection, the name does not really matter but I used My Site Host

image

this needs to use the My Site Host Enterprise template.

image

Don’t forget to pick the Personal Site quota template

image

Once your site collection has been created, head over to your UPS and find the Setup My Sites link

image

The only thing you need to change here is the My Site Host location value, make this the URL of the new Web application you have created.

image

We are almost finished, run a quick IIS reset and try to create a mysite, you might get the error below, as the managed path personal is the location used to navigate to mysites, but you can change it to anything you want.

image

So head back over to your CA site and add the personal managed path to the new web application.

image

If you try to create a mysite now, you might get a different error, as each mysite is actually its own site collection.

image

So head back to CA and switch on Self-Service Site Collection Creation in your new Web Application.

image 

Your new My Site host should be working.

If you want to bring in any mysites that you have created on another web app, go to CA-> Application Management –> Manage Content Databases.

image

Hit the Add a content database link

image

Pick the correct Web Application and enter the content database name that the other my sites exist in:

image

NOTE: The database you attach here cannot be attached to another web application in the same farm, but you can have more than one content database attached to any one web application.

Happy SharePointing !

Categories: SharePoint 2010 Tags:

SharePoint and fun with SP1

May 1, 2012 3 comments

Recently I was asked to take a look at a SharePoint 2010 system that was having a few problems. Looking at the patching status it was still running SPS2010 RTM, so the 1st job was to at least get SP1 installed, then the latest CUs on top, and so the fun started…

I downloaded the appropriate service packs, and kicked off the foundation SP1 install and got the following.

image

 

The error appeared straight away, no upgrade log was written, nothing in the ULS logs and nothing in the Windows logs.

I used /? switch on the end on the Service Pack file to get the usage options.

 

sharepointfoundation2010sp1-kb2460058-x64-fullfile-en-us.exe /?

 

image

Next I used the log option to have a look at the output of the Service Pack install

C:\patches>sharepointfoundation2010sp1-kb2460058-x64-fullfile-en-us.exe /log:c:\
patches\sp.log

 

There is quite a lot of information written to the log file, but nothing that pointed to the reason of the failure, next was to extract the patch and see which patch file was causing a problem.

C:\patches>sharepointfoundation2010sp1-kb2460058-x64-fullfile-en-us.exe /extract
:c:\patches\sp

the c:\patches\sp folder now contains the extracted patch files and the EULA text file

image

Running the patch wsssp1-x-none.msp was giving the following error.

 

image

So the Service Pack wouldn’t install because one of the patches inside it didn’t realise that SharePoint was installed, interesting as the error I would have expected to if SharePoint wasn’t installed would have been this one…

image

I tried running the Config Wizard, but that didn’t help either, after checking with one of colleagues who knows all about packaging software he thought that the failing msp was probably looking for a specific registry key or value.

So I decided to try running a repair from Control Panel, to reset all the original Server settings while not effecting the content or configuration databases (this process ran for quite a long while)

 

image

 

image

Then I re-ran the Config Wizard, (which now asked about removing the server from the farm).

Finally, after all this the Service Pack would finally install.

Another day done in the world of SharePoint.

Issue Downloading SharePoint 2010 Prerequisite Installer Files

April 25, 2012 2 comments

Strictly speaking this quick article doesn’t really have anything to with SharePoint, but hopefully it might help-out someone out there in SharePoint land.

One of the projects I’m currently working on is a 2010 Farm build, we are just getting the media set ready to install SharePoint with AutoSPInstaller, and of course need to download the Pre-Requisite Installer Files. For this particular project I have no local access to the servers so everything is being done by RDP on the server. So to download the Pre-Requisite Installer Files I’m was using this script from codeplex, but it was failing with a really wierd error

 

image

 

I tried it on a few different servers, but they all had the same problem.

I could of course simply open the script, grab the URL’s and paste them into a browser, but where is the fun in that.

This KB article talks about foreground / background transfers, and this being a problem when using background transfers and that foreground should be okay.

This article describes the cmdlet references for BITS and the –Priority switch that controls the foreground / background transfer setting

So the fix was to change this line

Start-BitsTransfer -Source $Url -Destination $DestFolder\$DestFileName -DisplayName "Downloading `’$DestFileName`’ to $DestFolder" -Priority High -Description "From $Url…" -ErrorVariable err

to this line

Start-BitsTransfer -Source $Url -Destination $DestFolder\$DestFileName -DisplayName "Downloading `’$DestFileName`’ to $DestFolder" -Priority Foreground -Description "From $Url…" -ErrorVariable err

and Voilá, pre-reqs downloaded . Smile

SharePoint and Document Versioning within Word.

April 23, 2012 5 comments

I was working with a client recently and looking at how they were using (or not in this case) versioning in document libraries, they were still in the NTFS mind-set, as shown by the example below.

image

To client was using the versioning that Word supplies and manually updating the document version number in the title each time a new version was uploaded into SharePoint.

I introduced them to the Major / Minor versioning settings within a document library, so we could at least get document versions working.

image

 

The only problem with this was that the client still wanted to have a version number on the document, as these were quite often printed.

This is a problem that I have seen before with SharePoint 2007 and have addressed with Information Management Policies,  this is the first time I have had to set this up for SharePoint 2010, but the steps are similar. From your Doc Lib, go to Library Settings, –> Information management policy settings.

image

image

In this example I am using the Document content type, but you should be looking to use your own custom content type, to make the final solution more flexible.

image

Tick the Enable Labels box, and in the label format type {Version}, click the Refresh button and make sure you see {_UIVersionString} in the Preview box.

image

image

We have now created a custom Label that will appear as a Quick Part within Word (the Word Doc has to be opened from SharePoint) that contains the SharePoint Version number.

image

image

 

Once you have saved and re-opened your document you will now have a Label field linked to your SharePoint Version Number.

image

 

Enjoy the SharePoint Goodness.

More fun with SharePoint Web Analytics

April 17, 2012 Leave a comment

Following on from yesterdays post regarding problems with getting into the CA site, today we got on with the job of looking at Web Analytics, and the reports that we can provide to end users.

So we checked the Web Analytics reports and could see good graphs like the ones below, very nice.

image

Just the sort of thing you could hand to a client.

So the next stage was to get the Schedule Web Analytics Reports workflow running and send the reports to a test user for analysis, this is when the fun started, no matter what we did the workflow simply refused to work, all we were getting was “An error has occurred in” and no reports, nothing in the ULS logs, nothing in the Event Viewer and nothing of any help in the Workflow History list, really handy, we knew that ‘normal’ workflows such as Approval worked fine on this system, so it was a bit baffling.

ErrorCapture

After a few(more) hours of head scratching I decided to try the Schedule Web Analytics Alerts workflow instead, which still failed, but at least gave out a more helpful error.

ErrorCapture2

Of course it turned out that our test account didn’t have a mailbox (duh!), so we used a different account (with a mailbox) and the Schedule Web Analytics Reports worked fine

But it really annoyed me that 2 workflows related to the same area in SharePoint have clearly been developed by different teams in Microsoft and both show different failure messages for the same event.

We go the reports out finally, and they are just straight Excel exports, so we might not even use them, another fun packed day working with SharePoint !

Design a site like this with WordPress.com
Get started