SEATTLE (Reuters) - Microsoft Corp agreed to buy online social network firm Yammer Inc for $1.2 billion in cash, which will allow the software company to offer a service like Facebook Inc's to corporate customers.