Final answer:
Dolores Umbridge was the Senior Undersecretary to the Minister at the Ministry of Magic during Harry Potter's trial for using underage magic.
Step-by-step explanation:
When Harry Potter is tried for using underage magic, Dolores Umbridge's position at the Ministry of Magic is Senior Undersecretary to the Minister. Umbridge is known for her support of strict rules and takes an interest in enforcing the Ministry's stance on magic use by underage wizards, which is why she is present at Harry's hearing.
Her role as the Senior Undersecretary is significant throughout the fifth book, 'Harry Potter and the Order of the Phoenix', where she later becomes a professor and subsequently the High Inquisitor of Hogwarts.