Here's a DIY for replacing the sensor. Doesn't look like the windshield has to come off.
http://www.bimmerboard.com/forums/posts/247857

I'm not quite sure if it's for E46 as I saw a picture of...