If you have the 2 button alarm fob with the red and grey buttons then this is how to reprogram it........
The alarm system is the BMW 3G alarm (Sigma Star).
Take the glove box out and there you will see a mountain of wires. At the very top of the car is a black box, this is the alarm console.
Now if your wanting just to re-program your alarm fob, you will notice a rubber grommet around here (you may need to take the unit out, which means unbolting all the other units underneath). When you take this rubber grommet out, there is a slide switch which moves from left to right.
** Please note the position it is currently in **
Flick this switch and then press the alarm fob button which you want to program. (you may need your ignition on too) and then flick the switch back. Should now work.
If you need to disarm the actual alarm, when you have the alarm control unit out, you'll notice that there is a top section about half the width of the actual unit, on the outer edge, get a flat screwdriver and pull it off. You will notice about 9 pins sticking up at you now which connects this top unit to the actual control unit, bridge over pins 3 and 5. Put the top unit on, take it off, put it on and your alarm is disarmed.
Some cars apparently might not be pins 3 and 5, so you need to bridge two of the pins using a piece of wire 2 at a time until you get the one beep which you would normally when disarming your car.
You should be now hopefully good to go.