Navigation

Wednesday, 16 March 2011

Visual Studio 2010 and Unlimited Test Users!

This one came a bit out of the blue, which I found while reading Chris O'Brien's excellent article on Optimising SharePoint 2010 Internet Sites.

It basically mentioned the new Microsoft initiative where
"active Visual Studio Ultimate with MSDN subscribers are provided a license key to generate UNLIMITED virtual users without having to purchase the Visual Studio Load Test Virtual User Pack 2010."
This is fantastic news, as previously that "Load Test Virtual User Pack" cost around £4000 per license and only added 1000 users at a time (this is on top of the already expensive £12,000 odd Visual Studio Ultimate license!!)

Note - all prices are approximate (read .. in my head)

More details can be found at the Microsoft article:

Visual Studio 2010 Load Test Feature Pack and Visual Studio Load Test Virtual User Pack 2010 Frequently Asked Questions (FAQ)

Friday, 4 March 2011

Attending SPRetreat #2 :)

Well, I snuck in last minute, but I'm managed to book myself a place at the March 2011 SPRetreat London session (Saturday March 5th).


This is the second SPRetreat, and once again joins Andrew Woodward (@AndrewWoody) as the expert in Unit Testing, Test Driven Development and usage of TypeMock Isolator with SharePoint development techniques.

http://spretreatlondon11.eventbrite.com/

Big thanks to:
 
Wes Hackett for organising and Content and Code for sponsoring the venue.
 
Typemock for providing a great product (Isolator) and for donating 2 full licenses as prizes worth almost £1,000
 
21apps for organising and providing the food.
 
Really looking forward to this :)


Tuesday, 8 February 2011

Now an MCPD in SharePoint 2010!

Well, I had a few days spare as my new contract hadn't started so was pondering what to do, and decided to sit the two developer based SharePoint 2010 Exams.

There are two of them in the new development based certification track for SharePoint:

The first exam will grant you an Microsoft Certified Technology Specialist and the second one the new Microsoft Certified Professional Developer.

I am very pleased to report that I passed both exams (yay me!) and can now proudly sport my new certification logos:






Friday, 28 January 2011

Microsoft Community Contributor Award 2011

Well, I got a very nice surprise today as I have been awarded the Microsoft Community Contributor Award for 2011.

This is an award given to people to "recognize notable contributions to Microsoft online community forums such as TechNet, MSDN®, and Answers".

For those not aware there are fantastic SharePoint forums on MSDN (http://social.technet.microsoft.com/Forums/en-US/category/sharepoint2010) and I can typically be found browsing the Development forum, answering the odd question here and there, so I am well chuffed to be recognised in such a way.

As well as my funky new logo / badge (below) I have also been awarded a Safari Books subscription for over 400 online Microsoft Press books! :) Which is extremely awesome.

So thank you to whomever put me forward for this, thanks to Microsoft for the recognition (and the prize) and thanks to the SharePoint community in general for making this product (and the community itself) so brilliant in itself!



Wednesday, 26 January 2011

Blank Ribbon? Check your Locale Settings!

We recently had this problem on a corporate Intranet. We setup the SharePoint farm and (being good boys) setup the regional settings to match the corporate culture (in this case .. we set it to United Kingdom).

Now, the United Kingdom locale happens to be a bit of a funny one .. apart from the fact that English people spend half their IT lives changing settings from "US" to "UK" (or bemoaning the fact that there IS no UK setting) and removing the Z in organisation.

It does seem though that SharePoint 2010 includes a few things to trip you up too! The following screenshot shows what happens you configure your Site Collection Regional Settings to Locale "United Kingdom":


As you can see, a whole raft of the ribbon buttons have disappeared. Why?

Well, looking in the DOM we can find a reference to the PNG Image which used to render the ribbon buttons:
/_layouts/2057/images/formatmap32x32.png
There is only one problem ... There is no Layouts/2057!

You see .. SharePoint is taking the local regional settings locale (United Kingdom) and is getting the language ID (en-GB) which is 2057 ... and then looks in the Layouts folder.
Note - On a default install this is setup as en-US, which is 1033

Normally you would install a Language Pack to support additional languages ... but United Kingdom is the same language (English) so it doesn't have one (2057 is in fact a sub-set of 1033).

Solution
There really is only one solution ... make sure your "Locale" is set to Enlgish (United States) but set the Time Zone to London (this will adjust the Date/Time formats).

Took a while to work this one out (kudos to Vikash Daya .. the Infrastructure Architect on the project who spotted it)

Wednesday, 17 November 2010

Code Solution - Import AD Photos into SharePoint User Profiles

[Update: Code download files updated 18/03/2011 - see below]

This is in relation to a previous post I made last week;
Active Directory Images are not imported by the SP2010 User Profile Import
So, the source code is finally ready and uploaded for your enjoyment :)

Now - I must first off give credit to the sources of inspiration. A lot of the code in this solution is copied / borrowed / inspired by the following posts:
All I have done is brought their code and samples together and packaged it into a WSP that runs from SharePoint Timer jobs, so you have the convenience of a SharePoint 2010 farm solution :)

Also it should be understood that both AD and the User Profile database are quite critical parts of anyone's SharePoint farm, so sorry, but first I need to make a ....

... Disclaimer - All code and solutions are provided "as is" and should be used at your own risk! It is highly recommended that you test these in an isolated environment, and I confer no responsibility for any loss or damage from using the code, advice or solutions provided on this blog, or any related content.

Ok, now that is out of the way we can get on with business :)

[Update - 18/03/2011 - I have updated both sets of files so that it now uses the "distinguishedName" attribute to identify users in AD .. as this is a more reliable method and was in response to a reported bug]

I have uploaded the files to my Sky Drive including:
When you roll out the WSP you will find that it includes the following functionality:

Farm Scoped Feature
The WSP package includes a farm scoped feature called:

Hatch Solutions - Import Photos from AD (Timer Job)

When activated this will automatically identify the default MySite host application and create a custom Timer Job (see below) attached to that web application.


My Site Timer Job
The Timer Job (installed by the Farm Feature) is designed to run on the My Site Host web application, and is pre-configured to run once-per hour. It is called:

Hatch Solutions - Import Photos from AD

This will do the following:
  • Automatically identify all AD accounts in the current User Profile Database
  • If the AD account has a "jpegPhoto" attribute, then this is extracted
  • The photo is converted to three thumbnail images, and uploaded to the My Site Host profile photo asset library
  • The photo for that user profile is updated to point at their newly uploaded photo


Hope you enjoy, the source code is there for all to see, and good luck!

Tuesday, 9 November 2010

Tip - CAML Query Retrieve tasks assigned to user (including both AD and SP Groups)

This is something I have seen so many people struggle with, but it really is very easy, with the help of the "<Membership>" element.

The Membership element allows you to basically check to see if the AssignedTo field is assigned to any group which the current user is a member of.

Of course, you still need to use it in conjunction with a standard FieldRef check against the user's ID (which you can get using the <UserID/> element.

Below is the CAML query to return All Tasks Assigned to the Current User, including specific assignments, and where the task is assigned to a group that contains the current user (both AD Groups and SharePoint Groups).

I suppose theoretically this should also work with groups in custom Membership Providers .. but haven't tried it.
<Where>
  <Or>
    <Eq>
      <FieldRef ID='Assigned To' />
      <Value Type='Integer'><UserID/></Value>
    </Eq>
    <Membership Type='CurrentUserGroups'>
        <FieldRef Name='AssignedTo' />
    </Membership>";
  </Or>
</Where>


Thursday, 4 November 2010

Active Directory Images are not imported by the SP2010 User Profile Import

This is something that I found when starting a new SharePoint 2010 (SP2010) Intranet project. You see, my client has quite a simple requirement, at least it seems that way at first.

They have an HR database which they use to store everything from employee details to security card information. For this reason they manage all of the employee photos here, and they are pushed into Active Directory (using the LDAP "jpegPhoto" attribute) to make them available in applications like Outlook.

So ... to put it quite simply .. they don't want to use SharePoint to upload their photos. In fact, they already have their photos in AD .. they just want to pull them into SharePoint 2010.

Can't we just map the Profile Property to AD and Import the value?
So here is where we hit the roadblock.. The Active Directory "jpegPhoto" attribute is of type "Binary Data" and the SharePoint 2010 User Profile property is of type HyperLink (as it typically links to an image in an Asset Library in the My Site Host site collection).

As a result, you cannot import it using SharePoint 2010 functionality (although it may be possible if you have also purchased the more sophisticated "ForeFront Identity Manager Synchronisation Server" product).

Options ??
Well .. SharePoint IS used as a development platform so there are some options. Obviously there is a full API for reading and writing in and out of the User Profile database (some more accessible than others).

There are a few good blog articles that you can follow if you want to build your own import function. If you are happy to wait a while longer then I already have my own solution which I will be posting up with the following features:

UPDATE - Full Source code and WSP now published

* WSP Package
* Farm scoped feature, which installs a Timer Job attached to the MySite web application
* Iterates through all User Profiles, and finds and extracts Binary image data from Active Directory
* Automatically creates thumbnailed images in the My Site Host Asset Library
* Automatically updates User Profiles to point to those new images

During my research Glyn Clough also pointed me in the direction of another solution which allows you to do the same using a Console Application... personally I prefer the more "SharePoint" route of Timer Job and WSP package :)

In the meantime, you can feel free to avail yourselves of these posts:


Friday, 15 October 2010

SUGUK London, 14th October Sandbox Development and jQuery

Well it was a great night last night. We had a really good turn out (around the 90 mark I think in the end) and it was a cracking dev-focused session.

Firstly, hats off to Jaap Vossers (@jvossers / blog.vossers.com) who stepped up for his first community event and gave a really good presentation on jQuery and SharePoint.

My personal favourites were the Developer Dashboard Visualiser (which created a graphical time-line of how long each page component took to load, which you could drill-into) and the Site Settings snap-in (which allowed you to drop in the "Site Settings" page for the current site by pressing Ctrl-S from any page!). Lots of content in there, including using Web Services and utilising some of the Client Object Model.

Finally Jaap ran a prize draw giving away 5 free copies of a jQuery development book! Good stuff!

My turn came next, presenting on SharePoint 2010 Sandbox Development. For those of you who follow me on Twitter (@MartinHatch) you will know that I accidentally deleted my virtual machines last week so had to rebuild my farm and re-code all my examples.

Well .. not one to try making things easier for myself I decided to code all of them from scratch (Sandbox Web Part, Full Trust Proxy and a Solution Validator).

The only one which didn't work was the Full Trust Proxy (I then found out I had a note in my slide deck on the "demo" slide which read - "make sure you re-start the Sandbox Service after you install the full-trust proxy" .. I have updated my slide deck now to include that VERY important line!) but overall I think it went very well and muchos thanks to all the feedback on Twitter (make sure you use the #SUGUK hashtag!)

My own slide decks and code samples can all be found on my Sky Drive account here:
http://cid-60f12a60288e5607.skydrive.live.com/redir.aspx?resid=60F12A60288E5607!621

Finally we had an impromtu "Ask the Experts Session" .. with the awesome team of Eric Shupps, Chris O'Brien, Andrew Woodward, Steve Smith, Jaap Vossers and myself!

The evening ended up with a SharePint (although I had to head off to get the last train out into the sussex wilderness I call home!).

If you were there .. hope you enjoyed it (all feedback welcome!). If not ... I hope to see you at the next SUGUK meeting! :)

Friday, 17 September 2010

Presenting at SUGUK London - October 14th

Yep, the next SharePoint User Group UK (SUGUK) London session has been announced, and I'm going to be presenting on Sandbox Development. (yay!)

The event is on October 14th 2010 at at Mostyn Hotel (Marble Arch, Bryanston Street, London, W1H 7BY) and the evening starts at 18:00.

I have the second slot and will be talking about Sandbox Development, a subject which I've been keenly interested in what with Content and Code's products and the expectation of SharePoint 2010 suposedly coming to BPOS (Microsoft's cloud services).
"This development focused session will walk through the new SharePoint 2010 Sandbox Solutions framework, including the architecture, configuration and development of Sandboxed solutions. Although covering off a few administrative functions do not be fooled .. we will be opening Visual Studio 2010, stepping through code and debugging processes!"
The session kicks off with Jaap Vossers talking about SharePoint and JQuery. I've been working with Jaap for several months now and some of the JQuery stuff he's done is fantastic, so this is well worth coming along for that session alone!
"This session will cover everything you need to know about harnessing the power of jQuery in your SharePoint sites. The introduction will look at getting started, the syntax and the plugins before we look at jQuery in a SharePoint context; the benefits, examples, calling web services, loading scripts and deployment. We will then cover the various frameworks and utilities (SPServices, jQueryLoader) before rounding off with a look at further integration opportunities in SP2010 and specifically the Client OM and REST. This is a technical session."
If you want to register then please sign up at the SUGUK Forum Post (http://suguk.org/forums/thread/25091.aspx).

I'm really looking forward to it, so please come along, and hopefully I'll see you there!