Command (afp:command=)

Description

sendMessage

Send a text message to connected AFP users. See “Sending a

 

Message to AFP Users” on page 142.

 

 

syncSharePoints

Update share point information after changing settings.

 

 

writeSettings

Equivalent to the standard serveradmin settings command,

 

but also returns a setting indicating whether the service needs to

 

be restarted. See “Using the serveradmin Tool” on page 48.

 

 

Listing Connected Users

You can use the getConnectedUsers command with the serveradmin tool to retrieve information about connected AFP users. In particular, you can use this command to retrieve the session IDs you need to disconnect or send messages to users.

To list connected users:

$ sudo serveradmin command afp:command = getConnectedUsers

The computer will respond with the following array of settings displayed for each connected user:

afp:usersArray:_array_index:i:disconnectID = <disconnectID>

afp:usersArray:_array_index:i:flags = <flags>

afp:usersArray:_array_index:i:ipAddress = <ipAddress>

afp:usersArray:_array_index:i:lastUseElapsedTime = <lastUseElapsed>

afp:usersArray:_array_index:i:loginElapsedTime = <loginElapsedTime>

afp:usersArray:_array_index:i:minsToDisconnect = <minsToDisconnect>

afp:usersArray:_array_index:i:name = <name>

afp:usersArray:_array_index:i:serviceType = <serviceType>

afp:usersArray:_array_index:i:sessionID = <sessionID>

afp:usersArray:_array_index:i:sessionType = <sessionType>

afp:usersArray:_array_index:i:state = <state>

Value returned by getConnectedUsers

 

(afp:usersArray:_array_index:<n>:)

Description

<disconnectID>

An integer that identifies this particular

 

disconnect. This will appear once a disconnect has

 

been issued.

 

 

<flags>

Indicates the type of user.

 

1-session belongs to the administrator

 

2-session belongs to a guest

 

4-session is sleeping

 

 

<ipAddress>

The user’s IP address.

 

 

<lastUseElapsed>

Time since the command was last run.

 

 

<login-elapsed-time>

The elapsed time since the user connected.

 

 

<minsToDisconnect>

The number of minutes between the time the

 

command is issued and the user is disconnected

 

 

<name>

The user’s name.

 

 

Chapter 9 Working with File Services

141

Page 141
Image 141
Apple Mac OS X Server manual Listing Connected Users, To list connected users, Value returned by getConnectedUsers