Alternately, you could use a batch file to manage this and run it as a script, if you do not want to use the GUI. Or you could just type it into a command line.
I would run it something like this, if you want to alter all the users across your domain.
dsquery users | dsmod user -hmdir \\server\users\$username$\
dsmod recognizes that the $username$ flag means the samid of the user that is piped to it from the dsquery command. It also recognizes this flag for the -profile command attached to the dsmod command.
Note: If your shared folder is a hidden share this will not work, the question mark in the hidden share fools the command into thinking you are starting the flag earlier then you really are. I have experimented with some escape characters for this but have not found any so far that resolves this issue.
If all your users are in a specific OU you need to change the dsquery command. For that command you need to add the fully qualified domain name of the OU that contains all the users you want to change. This can be found, funny enough, through the dsquery OU command.
The command would then look like this,
dsquery users [fully qualified domain name of the OU ] | dsmod user -hmdir \\server\users\$username$\
If you want to batch this and use a hidden share you can use a FOR loop to do so, but the syntax gets a bit convoluted because of the loops required to first extract all the users, then extract just their names, and then go back and plug that info into specific areas of a dsmod command. It's ugly, but I would do it something like this.
dsquery user [fully qualified domain name of the ou] > c:\users.txt & for /f "delims==, tokens=2" %A in (c:\users.txt) do (dsmod user "CN=%A[rest of FQDN here] -hmdir "\\server\users$\%A\" && del c:\users.txt -q
Note: If you use this in a batch file, the for loop token must be preceeded by double percentages, ie; %%A instead of %A
This queries all the users in the OU specified then outputs them to a file. It then runs a for loop, plucking the user's name out of the FQDNin the file and plugging it into a dsmod command that changes their home directory. Finally it cleans itself up by deleting the file it created if the for loop ran successfully.
I hope this helps, even if you don't use a batch file to do this particular job it can help you in the future. The nice thing about something like this is that you can save it and if you need to change something else in the future just a couple little changes and all you have to do is rerun it to make the changes you want. In addition if you find someone made unauthorized changes you can switch it back just with a double click.