It would appear so
It's hard to know if it's intended or not, but it is a consistent way to interpret the rules, depending on how you interpret p.54 of the Monster Manual, which tells us that:
A demon can be forced to disclose its name if charmed
There are two ways of reading this into your question:
- This specific rule overrides the general rules of Summon Greater Demon, and tells us that the only way to get a demon to disclose its true name is by charming it. The demon under your control via the casting of the spell is not technically charmed, so you'd need to charm it in order to learn its name
- This rule describes one possible way of learning a Demon's name, but there are others. This makes sense because the paragraph in question also lists 'ancient scrolls' as a possible way of learning a Demon's name. It's consistent that threats, bargains or other means of control could also be used to illicit a demon's name from the demon itself.
I'm sympathetic to the second ruling; I don't see anything to suggest that the charmed condition is the only way to get a demon to tell you its name. Since the spell places no limit on what the controlled demon can be commanded to do (ie. commands are limited by what the demon can do), it follows that you can command the demon to tell you its name.
This seems counterintuitive and might be unintended - it would be unusual for the spell to specify that 'the demon has disadvantage on this saving throw if you say its true name' when the spell gives the means of learning its true name, albeit at the cost of an action at the start of the hour-long casting time.
n't allow it at my table, but from what I can see it's totally aligned with the RAW
Edit: I've been reading some other opinions on this, and I'm not 100% sure that it isn't intended.
It's also worth noting the absence of any rules which dissuade the caster from harming the demon, or causing it to cause harm to itself. Many creature-control spells allow the saving throw to be repeated or cause the spell to end if the caster or their allies harm the charmed creature, and explicitly forbid commands that will directly imperil the creature. This spell has no such caveats: You could literally summon a demon and command it to stab itself in the face with zero penalty. Considering that this is the extent of your control over the creature, it's consistent to infer that you could ask the demon to tell you its name.