Authentic Supplication Number 162.

Allah The Exalted said with respect to the story of the two men: “Why do you not, when you enter into your garded say: Ma sha’a ‘allahu la quwwata ‘illa bil-lahi” (180).

It is reported byif the Prophet  that if he saw something he liked he would say ‘Al-hamdu lil-lahi ‘allathee bini`matihi tatimmus-salihatu (181), and if he saw something he disliked he would say, ‘Al-hamdu lil-lahi ‘ala kulli halin (182).

(180) ‘Allah’s Will [be done]! There is no strength but in Allah! This is from Surat ‘Al-Kahf (#18) V. 39.
(181) All praise is to Allah, by the Grace of Whom all good things are fulfilled.
(182) All praise is to Allah upon every circumstance.

Al-Albani said in his Saheeh Al-Jami’i ‘As-Sagheeri wa Ziyadatihi that it was sound, and that it was reported by Ibn Majah, by way of `Aishata. The supplication in this hadeeth is identical to #113 in The Authentic of Good Sayings; however the chain of narration for this hadeeth is more reliable according to Al-Albani.