There have been several famous guest stars throughout How I Met Your Mother's nine-season run, and Ashley Benson guest starred in one season 8 episode. Benson broke out when she portrayed the intelligent and funny Hanna Marin on Pretty Little Liars, and she joined several other TV actors who have also appeared in HIMYM guest roles, including Rachel Bloom, Bryan Cranston, and James Van Der Beek. Benson's TV career has been more successful than her film one, although she has had a few compelling movie roles, such as Brit in the 2012 dark comedy Spring Breakers.
https://screenrant.com/how-i-met-your-mother-ashley-benson-character-explained/