Managing NetServer from a Command Line Interface

Marc Vadeboncoeur, iTech Solutions

We all know and heavily rely upon IBM i’s venerable NetServer facility to serve-up IFS folders as standard SMB (Server Message Block) shares on our corporate networks, and to also allow our IBM i systems to act as SMB clients and access network file shares on other servers in heterogeneous environments via the QNTC facility.  So, if I were to ask the question, how can you configure/administer NetServer on an IBM i system, how many of you would only answer with only “Navigator for i”?


The answer is, there are actually two ways that you can effectively manage NetServer on IBM i:

  • Navigator for i
  • NETS menu command-line interface

Yes, there is actually a “green screen” way to fully manage NetServer on your system.  By default, IBM ships this capability inside of the IBM i operating system but, you first must “install” it onto your system, and the installation & use of the NETS menu functionality is the focus of this article.

Now, why would you use a command-line interface to manage your NetServer environment instead of the Navigator for i browser GUI?  Well, it would be for the same reason that you use the IBM i’s command-line interface for other system functions, speed, and accessibility.  For example, if you want to list all libraries on your system and you have a command line (5250) session open and the Navigator for i GUI open, you would most likely gravitate towards the 5250 command line and simply enter the WRKLIB *ALL command rather than go into the GUI and click… click… click… until you see the list of all libraries in the tree on the left of the web page. The command line is simply faster and gets you to where you have to go with fewer steps.  The same can be said for the NETS menu on the system when it comes to managing NetServer. You get to where you want to go faster & easier with command line ease.

Now, how do you get the NETS menu up & running on your system so you can start managing your NetServer environment from the command line?  Well, it’s fast & easy to do, and here’s how you do it:

IBM ships the NETS menu functionality packaged inside the QUSRTOOL library which you will have on your system if you have licensed program product (“LPP”) 5770SS1 option #7 installed.  The NETS menu functionality is simply a nice one-stop-shop that exposes the NetServer APIs as options off of a menu.  Simply enter the GO LICPGM command and take option #10 to list all of your installed LPP’s and if you see 5770SS1 option #7 installed as shown in the snippet below (as most systems do) then you have the NETS menu functionality and all you have to do is “extract” it and install it.

First, create a new library that will hold the utility and all its components:

CRTLIB LIB(NETSRVCMD) TEXT(‘NetServer Management Menu’)

Next, call the “UNPACKAGE” program in the QUSRTOOL library to extract the necessary objects:


Create the TZLSINST installation program:


Call the TZLSINST installation program to automatically install all of the NETS menu components:


Finally, add the new library NETSRVCMD to your interactive job’s library list and use the “GO” command to bring up the menu and you’re there:



When you enter the GO NETS menu to display the NetServer management menu, you are presented with this very powerful interface:

From this simple menu you can quickly and easily get to all the critical NetServer administration functions that you normally would invoke by clicking… clicking… clicking… through the Navigator for i web GUI, and it’s no clicking required here, just take a menu option to get a direct path to specifically what you want to do with your NetServer environment.

For example, you may have a user whose NetServer access has been disabled (a common problem in many shops), and re-enabling them can be a little tedious using the Navigator for i GUI, well, with the NETS menu in front of you simply take option #12 (“Work with NetServer Users”) and you go right to the list of disabled users and re-enable the user you want, and… done!

Say you want to work with a list of all IFS shares on your system, from one place, well, just take option #11 (“Work with NetServer Shares”) and you have it right in front of you:

From this screen, you have some really useful information and capability at your fingertips.  For example, to see if there are any client sessions currently accessing a specific share on your system, take option #8 (“Status”) on the share name and you’ll get a list of all client sessions currently attached to that share.  What if you want to change a share from read/write to read-only, then take option #2 (“Change”) on the share name and change the ACCLVL value from *RW to *R as shown here:

These are just a few examples of the powerful capabilities that the NETS menu will bring to you.  After you install the menu, explore all the options and you’ll be sure to find quite a few options that you will find to be of great utility.

It is very important to note that most of the management functions that are exposed on the NETS menu options are also directly accessible via specific commands in the NETSRVCMD library, the screenshots below show the many commands that are available to you for direct invocation from any command line or control language program.  What our very smart friends in IBM i development have done for us is create control language command “wrappers” around the NetServer APIs on the system that allows us direct command-line access to all the critical functions that you need to manage your entire NetServer environment with no need to get your hands all “GUI”!  Install the NETS menu and see for yourself.

Read more from this month:

Leave a Reply

Your email address will not be published. Required fields are marked *