Troubleshooting
Problem
This document provides the source code to create a program and command to easily enable a disabled NetServer user.
Resolving The Problem
This document provides the source code to create a program and command to easily enable a disabled NetServer user.
The following PTFs for NetServer remove the ability of the CHGUSRPRF command to reset, or enable, a user that is disabled for NetServer access:
540: MF55657
545: MF55658
610: MF55659
611: MF55660
710: MF55661
The release date for these PTFs was in 2012.
The user can be enabled by using the GO NETS menu, IBM Navigator for i, or by writing a program that makes use of the QZLSCHSI API. Because many people want a simple command-line option available to them to perform this task, IBM Support created a simple CL program to call the QZLSCHSI API. IBM is also providing the command source so that the program and command can be compiled to make it easier to use. The program takes a single user profile as an input parameter.
NOTE: Use of the QZLSCHSI API requires that you have *IOSYSCFG special authority. To use format ZLSS0200 to enable an IBM i NetServer user, you must also have *SECADM special authority and *OBJMGT and *USE authority to the system user profile. The QZLSCHSI API is documented in IBM Documentation.
A save file with a source file with the three members listed in the following text can be obtained from the following URL: https://public.dhe.ibm.com/services/us/igsc/cs2/ApiSamples/
The following PTFs for NetServer remove the ability of the CHGUSRPRF command to reset, or enable, a user that is disabled for NetServer access:
540: MF55657
545: MF55658
610: MF55659
611: MF55660
710: MF55661
The release date for these PTFs was in 2012.
The user can be enabled by using the GO NETS menu, IBM Navigator for i, or by writing a program that makes use of the QZLSCHSI API. Because many people want a simple command-line option available to them to perform this task, IBM Support created a simple CL program to call the QZLSCHSI API. IBM is also providing the command source so that the program and command can be compiled to make it easier to use. The program takes a single user profile as an input parameter.
NOTE: Use of the QZLSCHSI API requires that you have *IOSYSCFG special authority. To use format ZLSS0200 to enable an IBM i NetServer user, you must also have *SECADM special authority and *OBJMGT and *USE authority to the system user profile. The QZLSCHSI API is documented in IBM Documentation.
A save file with a source file with the three members listed in the following text can be obtained from the following URL: https://public.dhe.ibm.com/services/us/igsc/cs2/ApiSamples/
Contents of README.TXT member
/**
* The information contained in this document has not been submitted
* to any formal tests and is distributed on an 'As is' basis
* without any warranty either expressed or implied. The use of this
* information or the implementation of any of these techniques is a
* customer responsibility and depends on the customer's ability to
* evaluate and integrate them into the customer's operation
* environment. While each item may have been reviewed by IBM
* for accuracy in a specific situation, there is no guarantee that the
* same or similar results will be obtained elsewhere. Customers
* attempting to adapt these techniques to their environments do so
* at their own risk.
*/
Use the commands below to compile the program and the command.
The following command has to be modified to reflect the name of the library where you have restored
the source file and the library that you want to compile the program to. I would recommend that
the program be compiled to a library that is in the system portion of your library list. Change
YOURSYSLIB with the system library that the command and program should be created in and change
YOURSCRLIB to the name of the library where the source file has been restored.
If you want users without *IOSYSCFG and *JOBCTL special authority to be able to run the command,
you need to make sure that the owner that compiles the program and command have those authorities
and then use the options below to allow the program to adopt that authority.
CRTBNDCL PGM(YOURSYSLIB/RSTNETUSRP) SRCFILE(YOURSRCLIB/RSTNETUSR)
SRCMBR(RSTNETUSRP) OPTION(*EVENTF) USRPRF(*OWNER) REPLACE(*YES)
AUT(*USE) DBGVIEW(*SOURCE)
NOTE: On OS 540 only, before compiling the RSTNETUSRP program (using the command immediately above), you must remove the line from the RSTNETUSRP member that reads: DCLPRCOPT TEXT('Reset NetServer User') USRPRF(*OWNER)
The TEXT option is not available on OS 540 and the program will not compile if it is included. On 540 the compile will automatically set the adopted authority to *OWNER, so removing this line will not have any negative effect on the compiled program.
CRTCMD CMD(YOURSYSLIB/RSTNETUSR) PGM(YOURSYSLIB/RSTNETUSRP) SRCFILE(YOURSRCLIB/RSTNETUSR)
SRCMBR(RSTNETUSR) ALWLMTUSR(*YES) AUT(*USE) REPLACE(*YES)
Contents of the RSTNETUSRP.CLLE member
PGM PARM(&USRPRF)
/**************************************************************************/
/* */
/* The information contained in this document has not been submitted */
/* to any formal tests and is distributed on an 'As is' basis */
/* without any warranty either expressed or implied. The use of this */
/* information or the implementation of any of these techniques is a */
/* customer responsibility and depends on the customer's ability to */
/* evaluate and integrate them into the customer's operation */
/* environment. While each item may have been reviewed by IBM */
/* for accuracy in a specific situation, there is no guarantee that the */
/* same or similar results will be obtained elsewhere. Customers */
/* attempting to adapt these techniques to their environments do so */
/* at their own risk. */
/* */
/**************************************************************************/
/***********************************************************/
/* This program calls the QZLSCHSI API to re-enable a */
/* disabled NetServer user profile. */
/* */
/* Change Server Information (QZLSCHSI) API */
/* */
/* Required Parameter Group: */
/* */
/* 1 Request variable Input Char(*) */
/* 2 Length of request variable Input Binary(4) */
/* 3 Format Input Char(8) */
/* 4 Error Code I/O Char(*) */
/* */
/* Default Public Authority: *USE */
/* */
/* Threadsafe: No */
/* */
/***********************************************************/
DCL VAR(&USRPRF) TYPE(*CHAR) STG(*AUTO) LEN(10)
DCL VAR(&RQSVAR) TYPE(*CHAR) LEN(14)
DCL VAR(&RQSLEN) TYPE(*INT) VALUE(14)
DCLPRCOPT TEXT('Reset NetServer User') USRPRF(*OWNER)
/* Note that the first part of the value below is four */
/* (4) spaces. This sometimes appears compressed to */
/* when viewed on the web. */
CHGVAR VAR(&RQSVAR) VALUE(' ' *CAT &USRPRF)
CHGVAR VAR(%BINARY(&RQSVAR 1 4)) VALUE(&RQSLEN)
CALL QSYS/QZLSCHSI PARM(&RQSVAR &RQSLEN ZLSS0200 X'00000000')
ENDPGM
Contents of the RSTNETUSR.CMD member
CMD PROMPT('Enable a NetServer User')
PARM KWD(USER) TYPE(*CHAR) LEN(10) PROMPT('User Profile +
To Enable')
Related Information
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CLSAA2","label":"Integrated File System-\u003ENetServer"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]
Historical Number
633149683
Was this topic helpful?
Document Information
Modified date:
21 December 2023
UID
nas8N1010992