I had the same issue, but even though the headlight i replaced was damaged I did not get any msg on dash or Idrive. I replaced the shell but used the original ballasts and bulbs, did not have to program it.
this is what i had to deal with:
http://www.e90post.com/forums/showthread.php?t=724661