I had this issue for past month or so and just solved it. In my case, my 04 V8 AWD (125k miles) would get a vibration/rattling sound when in gear but stationary (e.g. when in D or R but foot on brake idling). As soon as I let foot off brake and started to move, it would disappear. It did not happen in park or neutral either. Oddly, it would only happen after warming up.
Problem: The front skid plate. It had one bolt (there are 4) that was not fully tightened. I change my own oil and remove this skid plate to replace filter. I noticed last couple times that upon tightening down this one bolt, it would seem "snugged down" and fully tightened, however it was actually not snugging the plate up against the frame completely. Perhaps a millimeter gap or so was still remaining. This was vibrating ... presumably sort of in a harmonic vibration sort of manner that took place from the engine under load of being in gear, but not moving. I put a washer on to fill the gap and ... voila ... silence. It was one of the front two bolts (I just put washers on both front bolts).
To see if this is your problem ... just push your foot up against it to see if it stops the rattle/vibration noise. You might best have another person in the car with the e-brake applied in addition to their foot on the brake while in gear to do this check safely. I put mine in reverse (with back end up against garage wall and e-brake applied) and hopped out and did this myself
.... not the safest/smartest thing.
Hope this helps ... and it can be an easy solution for one or more of you folks too.