Ziyar ibn Shahrakuya (Persian: کوی کشت و ابنشهر; also spelled Shahrakawayh), was a high-ranking Gilaki military officer who served the Buyids.
Ziyar had a cousin, who married the Buyid ruler Adud al-Dawla, and bore him one son named Abu Kalijar Marzuban.
During that period, Ziyar, along with a Daylamite officer named Fuladh ibn Manadhar, dominated the Buyid court of Baghdad.
After the death of Adud al-Dawla in 983, the Buyid Empire was thrown into civil war; the Empire was disputed between his two sons Abu Kalijar Marzuban (who took the name Samsam al-Dawla) and Sharaf al-Dawla.
However, Ziyar managed to make most of them change their mind and stay loyal to Samsam al-Dawla.