Just create a a unit-type array in the Trigger editor.
Set UnitType[0] = Peasant
Set UnitType[1] = Footman
Set UnitType[2] = Troll Headhunter
Set UnitType[3] = Ogre
Set UnitType[4] = Archer
......
then when you want a random unit just "Create 1 unitType[random integer between 0 and 4] at tempPoint1.
This way you also avoid creating unwanted units like heroes, buildings, critters, neutral buildings, gold mines, etc.
I see absolutely no reason to ever create a fully random unit in a balanced map. It could create anything from Archimonde, a insanely rigged divine armor AoE chaos damage hero with infinite spawns to a sheep which has a few HP and is totally harmless. You will need at least some system to create a random unit that is in the appropriate power range.
This would best be done using an array of unit types (or integer in the case of pure JASS). You then fill the array sequentially starting at index 0 with all the unit types you want to be randomly closable. You can choose a random unit type by a simple random integer index from 0 to the largest index number.
For multiple random tiers (great for RPGS where you do not want trash as a random choice late game or end game content as a random choice early game) you order the array in progressively increasing power. You then use a separate integer array that marks the separation of tiers (where one tier ends and the other starts). For variance (a choice between weaker and stronger tiers only around a certain tier) you can use an offset when accessing the tier array. The unit type created is then a random integer between certain tier values which you use the tier array to lookup.
The tier approach described is what Dungeon of Doom used for random monsters but with less complexity (no tiers, just progressive monsters in the list).
You will need to make a list as LordDz described or use a third party tool (LUA for JNGP used to do this but no longer works so is not an option, some other on-save script could also do it). I have no example of a working third party tool that can help next to one you would need to program yourself.Okay, except buildings and the ones with god armor. Is there a way?