I agree the raw command scripting on our current platform is pretty limited. There are cool things coming down the line here in the longhorn timeframe....if you are interested let me know and i'll see how much i can tell...
Now is a good time to give feedback, so if you have specific things you'd like the scripting / command shell guys to get please let me know. We are aware of the composibility and streaming issues and these are being addressed.
regarding the mail program, and assuming you really do need to do this however hard it is, could u use the windows scripting host for this, and write a cscript program. this would let you write in vb script or jscript. You can interface to the mail server through
CDO, and to the users info on the server through WMI ( presuming you need to tie these two together this way? )
assuming you have an smtp server the CDO code would go something like...
Set objMessage = CreateObject("CDO.Message")
you get the idea...i'm not a cdo expert but i imagine you can get to all the users info etc.
another option maybe is to use perl for this; there are certainly perl libraries available for all of this in the implementations i'm aware of...
when i had the same problem i just hacked it, and created a mail group containing all the users i wanted to send to, and changed the mail to Hello All. Assume your situation is more dynamic than this, and cheesy hacks like that won't work