I didn't understand your question of "When you ran SET from a cmd prompt, I guess you didn't find SECUDIR in the output ?"
The commands I ran are these:
1. set SECUDIR=F:\usr\sap\SH1\DVEBMGS01\sec
2. sapgenpse keytab -p SAPSNCSKERB.pse -a SL-ABAP-SH1@<DOMAIN>
3. sapgenpse seclogin -p SAPSNCSKERB.pse -O snl\SAPServiceSH1 -N
The output where we can see that the environmental variable is defined is below:
It could be confirmed also in RZ11 and SECUDIR parameter:
I have never defined the environmental variable in the windows environment and I have aswell checked in the configurations which I succeeded and there is nothing related with the SECUDIR or SNC_LIB
One question:
I think my problem is with the user I am logging to the server. I have checked in the AD and the user sh1adm is not created there, could it be the problem? For my succeeded configurations the users are created in AD like dg1adm, qg1adm etc...