Yes, this works
(As long as the creature fails the feeblemind save)
A creature can only continually save against Command Undead if it has an intelligence of 12 or higher:
If the target has an Intelligence of 8 or higher, it has advantage on the saving throw. If it fails the saving throw and has an Intelligence of 12 or higher, it can repeat the saving throw at the end of every hour until it succeeds and breaks free.
Feeblemind is Instantaneous and the affected creature doesn't get to save again for 30 days:
At the end of every 30 days, the creature can repeat its saving throw against this spell. If it succeeds on its saving throw, the spell ends.
The spell can also be ended by greater restoration, heal, or wish.
Also, feeblemind reduces Charisma too, so it is almost certain that the target fails the Command Undead save (since it would then have a -5 Charisma modifier).
Be mindful of Legendary Resistance
While keeping feeblemind active on a target is usually easy (as their Intelligence is reduced, so they almost certainly fail the 30 day save), traits like Legendary Resistance mean that the creature can choose to succeed anyway and break free after the month.
Make sure you command the creature not to use Legendary Resistance on feeblemind (or have it use up it's charges before the end of the day to be safe).
No, Summon Greater Demon is a specific rule that applies to that spell.
The Rule of that spell does not transfer to any other spell without that text.
You may issue your verbal commands for conjured beings at any time. They will execute your commands based on the commands you issue: Say: attack X, and it will attack X. Say defend yourself until X appears, then attack X and they will defend until X appears, a new command is issued, or they disappear.
If you don’t issue any commands to them, they defend themselves from hostile creatures, but otherwise take no actions.
Conjure Fey and Conjure Celestial also have the restriction that your commands are not obeyed if your commands violate their alignment.
as long as they don’t violate its alignment
See Conjure Animal
The summoned creatures are friendly to you and your companions. Roll initiative for the summoned creatures as a group, which has its own turns. They obey any verbal commands that you issue to them (no action required by you). If you don’t issue any commands to them, they defend themselves from hostile creatures, but otherwise take no actions.
You do not have to issue a new command to the conjured being each turn in order for it to follow its command on its next turn.
See XGTE, Summon Greater Demon, Page 166:
When you summon it and on each of your turns thereafter, you can issue a verbal command to it (requiring no action on your part), telling it what it must do on its next turn. If you issue no command, it spends its turn attacking any creature within reach that has attacked it.
At the end of each of the demon’s turns, it makes a Charisma saving throw. The demon has disadvantage on this saving throw if you say its true name. On a failed save, the demon continues to obey you. On a successful save, your control of the demon ends for the rest of the duration, and the demon spends its turns pursuing and attacking the nearest non-demons to the best of its ability.
This is especially important because conjured beings are friendly while demons are (almost every time) hostile. This is an issue of being in command and has severe consequences.
A conjured animal will stay friendly without you issuing commands on your turn. A summoned demon will act on its own.
Best Answer
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:
There are two ways of reading this into your question:
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.
I would
n'tallow it at my table, but from what I can see it's totally aligned with the RAWEdit: 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.