RE: further uses of serveradmin...
And not to mention that the new server app crashes at least once a day...
Thanks, very useful, gets me closer at least (not giving me the user names and allocated IPs but I can find that out other routes)
Hi dazey,
I just thought I'd add a few more serveradmin commands that you might find useful. For instance, say you wish to disconnect users who have mounted shared disks via AFP, then you could do the following (the lines beginning with # are comments): [execute as root or under sudo]
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# To turn on AFP Activity Logging:
serveradmin settings afp:activityLog = "yes"
# To disconnect a specific user from AFP:
# Find the user's sessionID:
serveradmin command afp:command = getConnectedUsers
afp:state = "RUNNING"
afp:usersArray:_array_index:0:lastUseElapsedTime = 22
afp:usersArray:_array_index:0:minsToDisconnect = 0
afp:usersArray:_array_index:0:sessionType = "tcp"
afp:usersArray:_array_index:0:state = 1
afp:usersArray:_array_index:0:serviceType = "afp"
afp:usersArray:_array_index:0:ipAddress = "10.0.0.100"
afp:usersArray:_array_index:0:sessionID = 124
afp:usersArray:_array_index:0:loginElapsedTime = 792
afp:usersArray:_array_index:0:disconnectID = 0
afp:usersArray:_array_index:0:name = "switon"
afp:usersArray:_array_index:0:flags = 1
afp:timeStamp = "2012-11-01 09:52:20 -0600"
# Disconnect user in 1 minute:
serveradmin command
afp:command = disconnectUsers
afp:message = "You are doomed, too"
afp:minutes = 1
afp:sessionIDsArray:_array_index:0 = 124
<Cntl-D>
#----------------------------------------------------------------------------
The above commands turn on AFP logging, determine the sessionID of a connected user, and then disconnects that user from AFP. This is just an example of the use of the serveradmin commandline.
Switon