Apple Mac OS X Server Network Card User Manual


 
Chapter 9 Working with File Services 155
List of SMB/CIFS serveradmin Commands
You can use these commands with the serveradmin tool to manage SMB/CIFS service.
See the examples in the following sections for details on how to use these commands.
Listing SMB/CIFS Users
You can use the serveradmin getConnectedUsers command to retrieve information
about connected SMB/CIFS users. For example, you can use this command to retrieve
the session IDs you need in order to disconnect users.
To list connected users:
$ sudo serveradmin command smb:command = getConnectedUsers
The computer will respond with the folowing array of settings displayed for each
connected user:
smb:usersArray:_array_index:i:loginElapsedTime = <login-elapsed-time>
smb:usersArray:_array_index:i:service = <service>
smb:usersArray:_array_index:i:connectAt = <connect-time>
smb:usersArray:_array_index:i:name = "<name>"
smb:usersArray:_array_index:i:ipAddress = "<ip-address>"
smb:usersArray:_array_index:i:sessionID = <sessionID>
Command (smb:command=) Description
disconnectUsers Disconnect SMB/CIFS users. See “Disconnecting SMB/CIFS Users”
on page 156.
getConnectedUsers List users currently connected to an SMB/CIFS service. See “Listing
SMB/CIFS Users” on page 155.
getHistory List connection statistics. See “Listing SMB/CIFS Service Statistics”
on page 156.
getLogPaths Show location of service log files. See “Viewing SMB/CIFS Service
Logs” on page 157.
syncPrefs Update the service to recognize changes in share points. See
“Updating Share Point Information” on page 157.
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.
Value returned by getConnectedUsers
(smb:usersArray:_array_index:<
n
>:) Description
<login-elapsed-time> The elapsed time since the user connected.
<service> The share point the user is accessing.
<connect-time> The date and time the user connected to the
server.
<name> The user’s name.
<ip-address> The user’s IP address.
<sessionID> An integer that identifies the user session.