Was there a new M to reflect the real M (or head of MI6) in James Bond?

Today I saw the real head of MI6 on tv (interview clip about wmd affair) and she dressed and looked a bit like the M character (Judi Dench) in the last 4 bond films.

So, was the character based on the ‘new’ real head of MI6 at the time?

IIRC, they do try to keep “M” updated, yes.