don't have experience of an M5, but my e34 525 has a square panel above the rear view mirror
this just pops out exposing the sunroof motor, which is held in by 3 star drive bolts
undo these, pull off electrical connections and fit new motor
bolt back up and replace panel
HTH
__________________
Let there be light, sound, drums, guitar
LET THERE BE ROCK