Abū Alī Hasan ibn Muhammad ibn Abbās (Persian: ابوعلی حسن بن محمد بن عباس), better known as Hasanak the Vizier (حسنک وزیر), also Hasanak Mīkālī (حسنک میکالی), was an Iranian statesman from the Mikalid family, who served as the vizier of the Ghaznavid sultan Mahmud from 1024 to 1030.
After having been removed from the vizierate, Hasanak still continued to be an important and influential figure in the Ghaznavid state.
However, he later fell out of favor and was executed by hanging during the reign of Mahmud's son Mas'ud I. Hasanak's official charge was infidelity which was a politically motivated charge, and his execution was ordered by the Abbasid caliph of Baghdad.
Mahmud later died in 1030, and a civil war shortly ensued between his two sons, the youngest one is the heir Mohammad Ghaznavi (who shortly had Hasanak changed with Abu Sahl Hamduwi as vizier), and the oldest one being Mas'ud I. Hasanak, along with Ali ibn Il-Arslan, supported Mohammad, and both expected that they would hold absolute power over the Ghaznavid state, while Mohammad would stay as a figurehead.
However, Ali, including another Ghaznavid statesman, began to become more distant from Hasanak and changed their adherence to Mas'ud I. Hasanak, however, continued to support Mohammad, but Mas'ud I shortly marched towards the Ghaznavid capital of Ghazni, where he successfully defeated Mohammad and imprisoned the latter.