SharePoint Tip of the Day – Add Alternate URL using stsadm (AAM)

If you try to automate as much as possible your solution deployment, you'll likely enjoy having your alternate access mappings deployed in a structured and repeatable way.
Turns out that it's quite easy and manageable by stsadm without doing some custom development.

To add an internal url to your web application :

stsadm -o addalternatedomain -url -urlzone Internet -incomingurl

And to add a public url :

stsadm -o addzoneurl -url http://SP2010:88 -urlzone Internet -zonemappedurl

Quite handy and something we can add to our little batch files that deploy our SharePoint solutions.