You can use all of them to connect to a server, Applescript is probably the simplest. You can browse files on a server in Finder and disconnect by "unmount" it, since the server shows up as a volume in finder. If authentication is needed, a dialog for login will be shown.
Just hit: ⌘ K
in Finder, if that manages to get the job done, then it can probably be done with a few lines of Apple script.