I have an example of three generations of a European family invading the Middle East.
Fredrick I Barbarossa, Emperor of the Romans, lead a large army in the Third Crusade but drowned when crossing a river in what is now Turkey.
His son Henry VI, Emperor of the Romans, sent a force of crusaders to the Middle East.
Henry VI's son, Emperor of the Romans Frederick II, married the Queen of Jerusalem, and led a crusade & negotiated the return of Jerusalem, and became King of Jerusalem.
As Spencer's answer says, definitions of "invaded" and "Middle East" may vary, but I think there are later examples than Nicholas I and Alexander II.
As I remember, George III was the King of Great Britain when Napoleon invaded the Middle East in the Egyptian expedition and British forces invaded the Middle East to fight Napoleon.
Two of George III's sons were Kings of the UK from 1820 to 1837, but I don't remember any invasions of the Middle East in their reigns.
Queen Victoria reigned from 1837 to 1901, and the UK sent several expeditions to fight in various regions of the Middle East in her reign, such as during the Egyptian Revolt and during the Mahdist War in the Sudan.
Queen Victoria's son, King and Emperor Edward VII, reigned from 1901-1910, during part of the 20 year struggle against the "Mad Mullah" in Somalia, that included a battle on 2 January 1904 where 1,000 Dervish were killed by British forces under General Charles Egerton. So it could be said that Edward VII invaded the Middle East. https://en.wikipedia.org/wiki/Mohammed_Abdullah_Hassan1
Edward VII's son George V was the king of the UK and Emperor of India when the UK & India invaded the Ottoman Empire in the Middle East in WWI.
George V's son George VI was the king and Emperor in WWII where the UK & India defended territories in the Middle East from Italian and German invaders, and also probably invaded a few countries in the Middle East such as Vichy French territories and Iran.
And George VI's daughter Elizabeth II was the Queen of the UK when the UK invaded Egypt during the Suez Canal crises in 1956 and was involved in the first and second Gulf Wars, etc.
Therefore, it seems probable that there are several overlapping examples of two generations of the British royal family reigning while Britain invaded the Middle East.