Well, Let's just think for a second and use this awesome thing called the brain. okay things we know
>Entire capital of Equestria was under assault by MASSIVE hordes of enemies
>Entire city had massive amounts of troops in it ready for assault
>we never saw the town under attack for long periods of time.
>we never saw the troops that were stationed in canterlot
>we never saw Luna
>the normal head of the guard was Incapacitated at the time

so my conclusion is, that while Celestia, Twilight and her friends were in the castle battling the queen of the changelings Luna was leading the the guard in shining armours place at the city. So all of you can stop dissing her for being useless, for all you know she was playing a key part in keeping heaps more changelings away from the castle.