Here's the UDF - I created it today (I know, not the tidiest - still got to clean it up a bit)

Code:
Function MapDrive($Drive, $Share, Optional $Server)
If $Drive NOT "" AND $Share NOT ""
Use $Drive /DELETE
If $Server NOT ""
Use $Drive "\\" + $Server + "\" + $Share
Else
; Used for \\server\share (i.e. the users home folder from AD)
Use $Drive $Share
EndIf

If @ERROR = 0 OR @ERROR = 1202
Color w/n
? $Drive + " drive - " + $Share + " on " + $FileServer + " - Attached"
Else
Color r+/n
? "Cannot connect to " + $Drive + "!! " + @SERROR
EndIf
EndIf

Color w/n
EndFunction