Wednesday, 31 August 2011

Sharepoint Dev TIP: Windows 7 services with SharePoint 2010

Hey all,
so we all have SharePoint 2010 with SQl on our 8GB dev machines (yay). A lot of the time I don't require this functionality (due to remoting to other environments) so it would be good to be able to stop a load of things to free up resources.
I have created two simple scripts which I use to turn services on and off. I appreciate that these are simple and are probably not necessarily definitive but its a good start.
Copy the commands, save as a .bat file and you are off.

StopServices.bat
echo Stopping sql server
C:\Windows\System32\net.exe stop mssqlserver
echo  sql server stopped
Echo stopping Sharepoint timer (OWSTIMER)
C:\Windows\System32\net.exe stop SPTimerV4
Echo Sharepoint timer (OWSTIMER) stopped
echo  Stopping iis
C:\Windows\System32\iisreset.exe /stop
echo  iis stopped
pause

StartServices.bat
echo Starting Forefront Identity Manager Service (Cos it got shut down in the sql stop
C:\Windows\System32\net.exe start FIMService
echo Forefront Identity Manager Service Started
echo Starting sql server
C:\Windows\System32\net.exe start mssqlserver
echo  sql server started
Echo Starting Sharepoint timer (OWSTIMER)
C:\Windows\System32\net.exe start SPTimerV4
Echo Sharepoint timer (OWSTIMER) started
echo  Starting iis
C:\Windows\System32\iisreset.exe /start
echo  iis started
pause

Monday, 18 July 2011

Sharepoint 2010 : Create a mysite for each SharePoint profile (Powershell)

So we have spent an amount of time (hopefully not too much ha) configuring the User profile service and the synchronisation which imports profiles from AD. Our filters are in place so we only have valid profiles.

For the next step we would like to automatically create all the mysites in one hit.

This may or may not be a good idea depending on your exact business requirements but if it is what you want here is a script which will iterate through the profiles and create you a my site for each user.

$site = new-object Microsoft.SharePoint.SPSite("http://mysitehost"); 
$ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site); 


$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext); 
$AllProfiles = $ProfileManager.GetEnumerator();


foreach($profile in $AllProfiles) 
  
     $profile.CreatePersonalSite();
}


Great fun don't you reckon.

Friday, 15 July 2011

SharePoint 2010 : Managed metadata refinement is missing from Search results

Problem
  • Search service application was indexing correctly
  • Out of the box Search site was returning content correctly as expected
  • Some search refiners were missing. Specifically the ones mapped to Managed metadata and  enterprise keyword columns.
Solution
 
After hunting about for a whole I found the solution which was actually very obvious on reflection but not so obvious when you have a farm sat in front of you.
 
Within the Search Service application, a crawl rule had been created which was set to include some items. There is a setting in there when including items to a specific path as follows:
  • Crawl SharePoint content as http pages
This was checked. After unchecking it and re-crawling the metadata refinement options were presented as expected. Obviously having it checked means that no metadata on documents and the like was being indexed.

As advised. Very simple and obvious. Once you know the solution
 

Friday, 24 June 2011

SharePoint Search Crawls : Incremental Cawls for Day to Day living

I was at Microsoft the other day talking to some of their PFEs regarding all things bright and SharePoint. The topic of search crawls came up. I received some information which I wasn't aware of which I thought I would log.
As most of us are aware SharePoint Search can conduct a "Full crawl" and an "Incremental crawl". What most people do (myself included in the past) is schedule a full crawl late evening / early morning and schedule incremental crawls at regular intervals throughout the day. To be honest I'm not sure where this habit came from. I guess it just seems to make sense......except it doesn't.

A scheduled Incremental crawl is sufficient for day to day crawling. There is no need and as far as MS have informed me, no advantage in running Full crawls on a regular basis. Full crawls are only required if a crawl rule or crawl property has been changed (there might be another couple of situations - but these are config changes).

All changes are stored in a change database and this is what the incremental crawl looks at to see what it needs to update. The changes database automatically clears down so you don't need to worry about it getting too big. There is one caveat and that is that the change database does clear itself after a certain amount of time so you have to make sure you do your incremental crawl within this time. This period is in the region of 30 days so assuming that you are going to schedule incremental crawls more frequently than this you are ok.

So, for day to day search indexing, only schedule incremental crawls.

Tuesday, 14 June 2011

SharePoint 2010 Send Documents to Records Centre Link

So I was wanting to know how to send documents to a record centre manually. Took me a little while to do the digging to find out were you configure the "Send to" links so I thought I would do a quick post to remind myself.

Assuming you all ready have a record store in place and you know the location. You must go to:

Central administration -> General application settings (on left hand side) -> Configure Send to connections

Once on this page you can add a new send to connection for a specific web application.
For sending records to the records centre you set the URL to be:

http://ServerNameOrAAM/RecordCenterSiteName/_vti_bin/officialfile.asmx

Once you have done this you are able to specify whether you need to copy, move or move  the document leaving a stub in its place.

Thursday, 2 June 2011

Copying dlls to and from the GAC in Windows server 2008

I have always had a cold feeling when attempting to add dlls to the gac on Windows server 200. This post here sorted me out although I did have to steal gacutil from my dev machine.

Installing an assembly into gac from windows server 2008

It also can be tough getting dlls from out of the GAC. This post hightlights the process for successfully copying all the dlls from the GAC into a specified folder.

Copying files from the gac

Very helpful when you have TFS With SharePoint WSS3.0 and for some reason content is referencing MOSS dlls.........the things we have to deal with hey.

Wednesday, 11 May 2011

Creating themes in PowerPoint 2010 for SharePoint 2010

A requirement was passed to me to do some light weight styling on a SharePoint 2010 site. Low and behold we enter the world of themes. Themes have been available in SharePoint in previous versions however there have been some improvements in 2010. The main improvement seems to be that you can now create themes in PowerPoint 2010, save them as a THMX file and then up load them to SharePoint for reuse on your sites.

I followed the article from the main man Joel but there was one thing which was not obvious to me from his article (no offence to the man because he truly is great) and that is that there is now a "Themes" gallery in SharePoint 2010 sites where you can store your themes. Excellent, this makes all our lives easier as we no longer need to deploy them to the server(s).

To locate the "Themes" gallery, navigate to the root site collection and view "Site settings". You will see the gallery in all its glory under "Galleries".....clever really.

View Joel's article SharePoint 2010 Themes and Resources for Upgrading a Custom Master Page .