Claim: Neil Patrick Harris was on How I Met Your Mother as Barney Stinson.

Neil Patrick Harris -LRB- born June 15 , 1973 -RRB- is an American actor , comedian , magician , singer , and composer , known primarily for his comedy roles on television and his dramatic and musical stage roles . On television , he is known for playing the title character on Doogie Howser , M.D. -LRB- 1989 -- 1993 -RRB- , Barney Stinson on How I Met Your Mother -LRB- 2005 -- 2014 , for which he was nominated for four Emmy Awards -RRB- , and Count Olaf on A Series of Unfortunate Events -LRB- 2017 onward -RRB- .   Harris is also known for his role as the title character in Joss Whedon 's musical Dr. Horrible 's Sing-Along Blog -LRB- 2008 -RRB- and a fictional version of himself in the Harold & Kumar film series -LRB- 2004 -- 2011 -RRB- . His other films include Starship Troopers -LRB- 1997 -RRB- , Beastly -LRB- 2011 -RRB- , The Smurfs -LRB- 2011 -RRB- , The Smurfs 2 -LRB- 2013 -RRB- , A Million Ways to Die in the West -LRB- 2014 -RRB- , and Gone Girl -LRB- 2014 -RRB- . In 2014 , he starred in the title role in Hedwig and the Angry Inch on Broadway , for which he won the 2014 Tony Award for Best Leading Actor in a Musical .   Harris has hosted the Tony Awards in 2009 , 2011 , 2012 , and 2013 , for which he won several special class Emmy Awards . He also hosted the Primetime Emmy Awards in 2009 and 2013 , and hosted the 87th Academy Awards in 2015 , thus making him the first openly gay man to host the Academy Awards .   Harris was named one of Time magazine 's 100 Most Influential People in 2010 . He is married to David Burtka . In 2010 , they got twins through surrogacy .