BMW E60 Oil Level Sensor Repair - 2004-2010 5 Series - All Models ↗
Photo procedure on a 2005 530i: belly pans and skid plate off, oil drained, sensor connector released and the three nuts holding the sensor in the sump removed; new sensor and seal, then refill.
Tools mentioned: 8/10/16/17 mm sockets, Phillips screwdriver, drain pan, jack stands
Shown on an M54 530i; N52/N62 cars use the other sensor but the same approach. AWD (xi) sumps differ.