As of Server.app v5.7.1 Apple moved the filesharing service to the Sharing
control panel. Since then, GUI options for managing AFP and SMB shares are sparse and the command line is our new friend.
Don’t forget to add /Applications/Server.app/Contents/ServerRoot/usr/sbin/
to your PATH
variable.
Edit AFP/SMB network volumes
The sharing
tool comes in handy, for example, to use a customized volume name. By default, creating a network volume in the Sharing Control panel of system Preferences uses the last component of the directory’s path name (Finder’s folder name) as the network volume name. For example, to change the network name of the shared folder 3PAR-LUN
to Users
for both the AFP and SMB protocol, do
sudo sharing -e 3PAR-LUN -A Users -S Users
Show connected AFP/SMB users
Figuring out the connected users appears to be impossible from within the control panel. However Server.app comes with the /Applications/Server.app/Contents/ServerRoot/usr/sbin/serveradmin
command-line tool. Finding AFP or SMB users is easy with these:
# show users of the AFP service
sudo serveradmin command afp:command = getConnectedUsers| grep "name ="
# show users of the SMB service
sudo serveradmin command smb:command = getConnectedUsers | grep "name ="