How do I fix my 2009 BMW 5 series touring?

The solonoid switch which open/locks the rear window in the tailgate of my 5 series is playing up. It operates and unlocks the window spontaneously. How do I test/replace it?
Jem, February 2012


done
It is not under warranty any longer. Too many miles.

Jem, February 2012
is the motor still under warranty?

cdc, February 2012
link Click here to see other fixes for BMW 5 Series.