Microsoft posted its first quarterly loss in its 26 years as a public company on Thursday blaming its struggling online ad business for which it said it would take a $6.2 billion charge for its 2007 purchase of online ad service aQuantive. The amount reflected the bulk of the $6.3 billion acquisition cost.