Share via


3.1 Example 1: Creating an SMB Share

This example demonstrates the use cases that are described in section 2.5.1.1.

The sequence in this example describes how the application creates an SMB share at a given path in the object store of a given server.

Prerequisites

  • The participating client and server computers are configured to belong to the same Active Directory domain.

  • The admin tool has acquired an RPC calling context by using the procedure, as described in [MS-SRVS] section 2.1.

  • The specific path that is to be provisioned for remote access must exist in the local object store of the file server.

Initial System State

A share with the specified share name does not exist on the server computer.

Final System State

A share with the specified share name is created on the server computer.

The following sequence diagram shows the creation of a share on the SMB server by the admin tool.

Sequence diagram for creating an SMB share

Figure 11: Sequence diagram for creating an SMB share

Sequence of Events

  1. The admin client calls the NetrShareGetInfo method ([MS-SRVS] section 3.1.4.10). It specifies the share name and server name to check if a share with the given name exists.

  2. The SMB File Service returns the NERR_NetNameNotFound error code to indicate that the share with the given name does not exist.

  3. The admin client invokes the NetprNameValidate method ([MS-SRVS] section 3.1.4.32) to check the share name.

  4. The SMB File Service returns a success code.

  5. The admin client calls the NetrShareAdd method ([MS-SRVS] section 3.1.4.7). It specifies the share name, local object store path, and various options that are provided by the caller.

  6. The SMB File Service returns a success code.

  7. The admin client calls the NetrShareSetInfo method ([MS-SRVS] section 3.1.4.11). It specifies the share name and the access permissions.

  8. The SMB File Service returns a success code.