Assalamualaikum ustaz. An imam forgets to set the intention for Friday prayer. He only realized this after he has completed the prayer. What is the status of the said prayer?
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions and all those who follow his footsteps until the Last Day.
Regarding the above question, first, the meaning of intention should be understood. An intention is:
قَصْدُ الشَيْءِ مُقْتَرِنًا بِفِعْلِهِ ، وَمَحَلُّهَا القَلْبُ
“Meaning to do something followed by the action of doing it. And the place for intention in one’s heart.” 
Here, we first present the conditions of the intention to be an imam for a person who is going to lead the congregational prayer.
According to madhhab Syafi’i, it is not obligatory to set the intention to be an imam for congregational prayer. Even if the imam didn’t set the intention for such, the congregational prayer is still valid. This matter is explained by Imam al-Nawawi, he said: “Regarding the opinion of scholars about the intention to be an imam (congregational prayer), we have stated that the famous opinion according to our madhhab is that it is not a condition for the congregational prayer to be valid.” 
However, if a person didn’t set the intention to be an imam in a congregation, then he’ll not receive the rewards for congregational prayer, but his prayer is still valid. This matter is stated in the book ‘Umdah al-Salik (pg. 122): “An imam should set the intention of being an imam. If he left it (intention of being an imam), then the prayer is considered as a prayer performed alone and the congregants’ prayers are valid, though the imam missed the rewards of congregational prayer. The intention is a condition for Friday prayer.” 
The above question shows that he forgot to set the intention to be an imam. However, the qarinah of standing in front of the congregants, reciting al-Fatihah and surah loudly, clearly shows that he is aware that he is the imam.
Thus, in our opinion, in actuality, he did set his intention, just that he may not verbalize or state in his heart the word “إمَامًا”. Hence, the prayer is valid and it is considered as an imam and makmum relationship in congregational prayer for that Friday prayer.
May Allah SWT grant us understanding in the religion and that we can practise them the best we could. Amin.