It is revealed in the Qur’an that Dhu'l Qarnayn (as) and the Prophet Solomon (as) caused Islamic moral values to prevail throughout the world. In the hadiths it is revealed that, just like them, Hazrat Mahdi (as) will do the same:
Four people became kings on Earth. Two are believers, two are unbelievers. The believers are Dhu'l-Qarnayn (as) and the Prophet Solomon (as); the unbelievers are Nimrod and Bakhtinasr (Nebuchadnezzar). One from the people of my house [Hazrat Mahdi (as)] will come as the fifth, and he will be king on Earth. (Al-Muttaqi al-Hindi, Al-Burhan fi Alamat al-Mahdi Akhir az-Zaman, p. 10)
Hazrat Mahdi (as) will rule the world just like the Prophet Solomon (as) and Dhu’l-Qarnayn (as). (Ibn Hajar al-Haythami, Al-Qawl al-Mukhtasar fi `Alamat al-Mahdi al-Muntadhar, p. 30)