I recently had to get a new smart key for my 2007 M. I took the spare key I bought from Ebay to a locksmith who specializes in smart key programming. Turns out he was unable to get it to do more than unlock the doors. This locksmith tried 4 different infiniti keys from his stock before he found one that would actually do everything - he took the key I bought 'in trade' so there was no charge for the key he used. He charged me $40 to program it and said that was a discounted price because I had to make two trips to his shop.
I checked with my service guy at the dealer after that episode and he told me the M's are among the most difficult of infinitis to program even by the best locksmiths and frequently his guys have to try different infiniti keys from their stock before they find one that will accept all the programs do all the functions. He said the G's & FX's are all easy fixes but the Ms are frequently a pain.
So .... after all that blathering ... my advise is to do what I did - use a locksmith who says they specialize in smart keys. Judging from the equipment this locksmith used (something that plugged into the car, another hand held thing almost the size of a tablet he typed into, and a laptop) ... all this while talking on a mobile phone (no clue what he was saying because he happened to be Persian) I doubt anyone can do this on their own.