Monday 16 August 2010

Using PowerShell to retrieve SharePoint site column guids

Problem: I am creating a Content Type that uses 1 of the built in site columns (field column), I need the guid of a OOTB site column.  I am looking to use the OOTB "Append-Only Comments" site column.
Resolution: Open PowerShell and execute the cmd:
$web = Get-SPweb http://demo1
write-host $web.Fields["Append-Only Comments"].Id

Tip: Don't add xml comments into declaritive content type creation, it stops the activation without any warning. 

SharePoint 2010 Error occurred in deployment of step ‘Activate Features’: the field with ID defined in feature was found in the current site collection or in a sub site.

Problem: I can't redeploy Site columns using Visual studio 2010 to an SP2010 site collection.  I get the error "Error occurred in deployment of step ‘Activate Features’: the field with ID defined in feature was found in the current site collection or in a sub site".
Resolution: Retract wsp, restart VS2010, open the project and deploy the solution.  VS2010 is caching data.
Microsoft kb

Friday 13 August 2010

SharePoint 2010 Software Licencing

Rough idea of pricing excluding VAT.  This is not from Microsoft and pricing is not fixed as I have laid it out in this post.  Saying that, please consult a licencing expert most resellers such as HP have licencing experts to help you, this is merely a guide to help you get started.  Without further procrastination ...
Windows 2008 & SharePoint is priced on a per server basis.  SQL is charged at a per processor licence.  Software assurance is about and additional 28-30/year.
  • Windows 2008 R2 standard x64 - £2,5k
  • SharePoint Std Internet - 5,5K ?
  • SharePoint Ent Internet - 20K ?
  • SharePoint Std Internal - 3K ?
  • SharePoint Ent Internal - ?
  • SharePoint Std CAL £45/cal
  • SharePoint Ent CAL £80/cal
  • SQL 2008 R2 Std/proc £3,5k
  • SQL 2008 R2 Ent/Proc £14k
Software Assurance: MS sell software assurance, this entitles you to upgrade over the period of the SA agreement charged at about 30% per year. If the new version of the product is due for release and you will move to the new version in the next year or 2, Software assurance may be a good option. However as SP2010 has just been re4lease and SharePoint 15 is due some time in 2014, the cost of SA for that period would be more than buying the SP15 software (assuming prices stay the same). It is a per circumstances decision but I would opt to buy the SP2010 without SA, in 2014 buy new licences and the cost will most likely be lower for the upgrade and it will allow for a in-place upgrade (I.e. SP2010 and SP2014 would run next to each other until everything is upgraded). I would personally prefer to do the upgrade as it will keep the systems cleaner, have better performance and allow for a safer upgrade. Also not you can use Enterprise agreements and stop paying SA but the key if to look at minimising the cost of SharePoint licences over a 5 or 6 year period.

Tip: Licencing prices change depending on factors such as volume discounts, types of licences, software assurance, are you a charity, are you buying or renting licences.  This post takes a simplistic view of SharePoint licencing and is not Microsoft's policy but merely to help mine the licencing minefield that faces most big software projects.  Please consult a licencing expert, it will save you time and money.
Tip: Windows External Connector licences for Windows 2008 (Needed for SharePoint 2010 Internet licences if the external users will use any file or print functionality provided by Windows)
More Info:
Microsoft's SharePoint Licencing
Development Platform Stack (SharePoint versions for developers)
Update: 15 Nov 2010 - Microsoft SharePoint 2010 for Internet explained A good document explaining mix of Internet and Intranet usage
SharePoint 2010 version comparisons
 Licencing explained -
Ari's blog - licencing
http://stovereffect.com/2010/07/03/sharepoint-2010-licensing-part-v-sharepoint-2010-licensing-costs/
Lync licencing - Office Communicator 2007 R2 upgrade
Developer & UAT licences would be covered by MSDN/technet subscriptions.  Technet does not include Visual Studio 2010.

VS2010 & TFS licencing

   ========
Example to explain licencing
Scenario:
We have 700 internal users with AD accounts.  We have 15 external suppliers with a total of 2000 users that access our SP2010 system.  We have a dedicated physical SQL Server 2008 R2 std edition and 2 SharePoint NLB Windows 2008R2 std edition web servers.  What licences do we need? 
Assumptions:
Prices are my estimated guess.
Software assurance (SA) is not selected, simply multiply by 1.6 for a rough figure.
Resolution:
3 Windows 2008 R2 licences for the SQL box and 2 web servers.  +-£7K
SQL Server licences charged at per CPU.  4CPUs for +-£14K
SP2010 Std edition licences for the 700 internal users at £3K/server for 2 servers +- £6K
SP2010 Std edition licences for the external/Internet licence users at £5,5K/server for 2 servers +- £11K
700 Std user SP2010 cal's @£45/user  +- £31,5K
Total Software estimate:  £69.5K
Note: As you can see you have to pay for 4 server licences on 2 servers.  Those astute people out there may realise that you could add 2 more SP 2010 servers to your farm without paying for and more SP licences.  Only think is you need to then only allow internal access on the Internal servers and Internet access to the external SP server.

Development Licences
Technet covers all development licences you will need with the exception of Visual Studio.  MSDN licencing includes Visual Studio 2010.  Visual Studio Ultimate, & Professinal can be purchase individually or through MSDN.
TFS 2010 (Team Foundation Server) has 3 ways to get licences:
  • MSDN - individual all versions get 1 instance licence & 1 Cal with a MSDN subscription.
  • Volume licencing – each person accessing TFS server needs a Cal.
  • Retails – Organisation gets 1 instance of TFS & 5 Cal’s. Approx £500.
Any TFS instance needs SQL 2008 standard edition, this is included in the TFS licence.  Can't use this free version of SQL Server for anything else.

Update 8 Mar 2011: Ari Bakker Post of Web Parts by SP licence Type
Update 10 Nov 2011: Technet

More Info:
http://stovereffect.com/2010/07/01/sharepoint-2010-licensing-part-iii-search-office-web-applications-and-project-server/
http://www.directionsonmicrosoft.com/microsoft-licensing/30-licensing/1458-sharepoint-server-2010-licensing.html

SharePoint 2010 console application System.IO.FileNotFound error

Problem: Built a local console app to access a SharePoint site, add System.Web & Microsoft.SharePoint references to the console project.  Run the code and get a System.IO.FileNotFound error.
Code SPSite site = new SPSite(http://demo1);
Hypothesis: Check url is correct (it was).  VS2010 console apps are set to be x86 by default.  SharEPoint only works on x64 so Microsoft.SharePoint is x64. 
Resolution:  Open VS2010, right click the console project.  "Properties" > "Build" tab, set "Platform target to "x64".
Tip: Uses the .NET 3.5 for console applications.
More info:  Top 2 search on Google yielded the solution.  Console FileNotFound error. and 2nd solution System.IO.FileNotFound Error

Wednesday 11 August 2010

Feature Receiver for dispaying Publishing Images as html in a document library

Problem: Publishing images can't be created on a document library however, using a site columns you can add Publishing Images & Publishing Html.  However the Fields don't display properly unless you create the content type from the site columns and lastly generate the document library from the content type.  I already have data so I need the existing columns to display as a custom list publishing image would work.

Resolution: Create a feature receiver to change the column properties pragmatically.  There is a catch in that this only applies if you haven't created the document library off the content type which in turn was created off the site columns.  Anyway, attached is a feature receiver scoped at web level look at the customised document library and make the publishing field rich text compliant.  

SharePoint 2010 feature receiver not working

Problem: Feature receiver is not firing.
Hypothesis: It's hard to debug feature receivers but it can be setup, however my feature receiver was never getting called.  Implemntation via VS2010 must be wrong.
Resolution: I created a new feature and added a feature receiver, this was working.  The screen shot below shows the differnce in my features that was cause when I renamed the feature.

Number of Accounts needed for SP2010 & Managed service accounts

Problem: How many accounts are required for SharePoint 2010?
Hypothesis: In MOSS I used 7 accounts for farm installs using my default slip-steamed medium/large farm install.  It really depended on what you needed to run.  You can use service accounts to run services in SP2010.
Resolution: SP2010 introduces managed service accounts, that are used for running SharePoint services.  You don't need to know password and it changes the account passwords per your SharePoint policy so a better option in my opinion so I have used them on my 2 installs.  Also pretty nice to only require the 3 accounts for install as shown below:
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/a740e3ee-6f2d-473e-a63b-d97e52513754
http://technet.microsoft.com/en-us/library/ee662513(office.14).aspx

Summary:
Need AD accounts
  1. Administrator account (Admin on local SP boxes, needs domain user account permissions, pref db owner
  2. Farm service account/database access account (needs domain user account permissions)
  3. Microsoft SharePoint Foundation 2010 search service account (needs domain user account permissions)