I would say that L.Dutch is correct as far as armored opponents and opposing archers go, but you know what else a warhammer regiment would be good against?
Unarmored/lightly armored opponents-Little to no protection against a devastating weapon? Oh yeah, these enemies better run. (Unless they're all archers.....=( )
Shield Walls (maybe)-Once an army forms a shield wall, you can't advance without breaking the wall. Big, heavy hammers would likely be ideal for smashing through a shield wall, perhaps with a pole-like handle (for greater reach) and used when mounted to keep away from the spears that are almost invariably wielded by the soldiers composing the shield wall.
Drawbridges/Walls/Porticullis (maybe)-All of these three things are meant to deny access to enemies, but depending on what materials your hammers are made of, your warhammer regiment just might smash right through all of them, within reason. A log cabin's walls? Certainly, you can smash through that. A castle wall? No go.
Squooshy Mages (situational)-Powerful mages could absolutely destroy your warhammer regiment by flinging lightning bolts or boulders, freezing them solid, siccing an elemental on them, and so forth. However, a well-timed (and accurate) hammer throw can both interrupt the casting of a spell or performance of a ritual and kill the mage responsible. Additionally, in close range, a mage is unlikely to do well against a big, heavy dude in armor with a big, heavy hammer.
Certain Elementals-Earth, Metal, and Ice elementals will fear a warhammer attack since that could shatter (or dent) their bodies.
Hordes-Think goblins or Silverfish in Minecraft; the powerful blows and large size of a warhammer would make them quite effective against hordes of small enemies as long as the regiment can keep up an appropriate pace.
However, they wouldn't be good against:
Archers-Seriously, the advantage archers with armor-piercing arrows would have against big, heavy targets like your warhammer regiment cannot be understated. Please give them a chance and give them shields comparable to their warhammers!
Cavalry-So-so effectiveness; cavalry would be faster, and therefore capable of dodging your regiment's attacks. However, if a thrown warhammer did hit a rider, chances are he's dead, and if it hits the horse's head or legs, say good-bye to that horse; that soldier just got demoted to infantry.
Ballista-See Archers above. The same goes for any siege weapon.
Naval forces-While a warhammer capable of smashing through stone would also be capable of smashing through a ship's hull (and therefore sinking it), what are the chances of your regiment being close enough to throw their warhammers accurately enough to do that?
Guerilla Warfare-Your regiment is big, heavy, and slow. They'll need a lot of food to keep up their strength (and they're good targets) so irregular warfare would be highly effective and likely drive them batty.
Castles-While your regiment can be reasonably successful against a castle's entry points, castles have high defenses that will make your regiment highly unlikely to even get there and a battering ram is much better for that purpose.
Dragons-Since they're big and slow, chances are they won't be able to dodge dragonfire and therefore won't survive. Even if they were close enough for melee attacks, I don't feel like a warhammer would be very effective against a dragon's hard scales and thick hide. Piercing weapons are key against a dragon, not warhammers. War picks would be great though.
Pixies-Extremely small, agile targets? Yeah, your regiment doesn't have a chance of hitting them, except accidentally. Elves would be reasonably good against your regiment for the same reason, however they would also be weak against warhammer attacks (since LoTR mithril doesn't seem to have the necessary properties to negate concussive force, and Elves are almost always lean and therefore fragile.....).
Certain Elementals-Water, Air, Fire, Electric, Light, and Dark elementals won't be tangible enough to be affected by warhammer strikes.
Merpeople (situational)-On land, merpeople are likely slow and fragile, vulnerable to warhammer attacks, unless they're adapted to deep-sea pressures, in which case I don't see them being affected by bludgeoning weapons at all. In water, merpeople will be way too fast for your regiment to even hit them, and warhammers wouldn't work well underwater anyway! If Naiads exist, even worse-they have a nasty habit of drowning people, and so they'll likely be strong and smart enough to overpower and disarm members of your regiment.
In conclusion, I would give your warhammer regiment shields and specially designed armor to protect them from archers and see about increasing their speed and agility through some method (enhancing runes, perhaps, or armor enchanted to enhance the wearer's speed and dexterity?). Another interesting idea, inspired by another person's magic musket question, would be to make your warhammers large (think bazooka-size) blunderbuss-type weapons with a hammer-shaped end. The gun barrel would be bored down the middle of the warhammer's top so that you could level the warhammer to shoot, or bring down the gun to smash someone. This gun would likely be held under the arm, with both arms, or on the shoulder. Hope this helps!