Ilansu
24th February 2002, 12:58
Hello all

I’m new in this forum and this is my first thread .

I’m using a Novell NetWare on my PC and I need to get the Novell Login Name.
Any one know how ?

Thanks in advance

Ilan

alejandro
24th February 2002, 13:35
Here I attach you code in Visual Basic that uses Api Novell.

I'm not sure if it works for every Novell version.
For me it works in Client Version 3.1.0.0

In the web it is not easy to find information, at least for me. In this code you have commentaries about web links.

If you do not use VB, you can insert the whole code in Excel, and it will work too.

Ilansu
24th February 2002, 16:51
Thanks for the quick response

I need to do it in a number of clients .
I'm using Baan 4 C4 .

Can I do it without using a third party ?

Ilan

mark_h
25th February 2002, 02:57
Welcome to the forum!!! This one is much better than the other forum you posted in. :) I check there once in a blue moon.

Does logname$ not work on a Baan Novell server? I am not real clear if the server is Novell Netware or the client, or both?

If not, is there a netware command that you can run that gets you the info you want? If so then in Baan you can write a routine that calls the Novell Netware command. You could run app_start (sorry I can not remember the format), trap the output, then read it back in all using Baan commands. There are some samples in the code and utilities forum the include the app_start command.

Also I wonder if there is an environment variable that has the userid in it and if you can use the same commands in Baan that you use to get Unix variables.

Mark

mark_h
25th February 2002, 19:08
Found this on the knowledge quest CD.

NAME getenv$ - function for retrieving environment variables
SYNOPSIS string GETENV$( string env_var(256) )
DESCRIPTION The function GETENV$ returns the value of the specified environment variable of the operating system. If the specified variable is not available an empty string ("") is returned.
Example:
string name(15)
name = getenv$("LOGNAME")

So it looks like if you have an environment variable with the user id you could get it using the getenv command. I know it works on our UNIX server, but I am not sure about a Novell server.

Mark

alejandro
25th February 2002, 19:45
Mark,

I think Ilansu sholud tell us a little bit information about his needs.
We use Novell too, but only like file server.

We use BaaN in Unix. Unix's lognames are different than Novell's ones. I think Novell is not for use with BaaN. When I make remotes connections to BaaN, I do not connect to Novell. (Poor transfer speed)

In previous Novell versions (MS-DOS) there was a command 'whoami' that returned you the logname.

In windows this command did not work. So I found the VB code attached before. In the example the return value comes with a message box. I use it with BaaN with an app_start, the value returned is written in a file (within the VB code), and from BaaN I read it with seq.open.local to take this value.

I think getenv$, will return him only UNIX variables, because if they use Novell, I do not beleive they use NT.

Hope Ilansu will tell us?

Ilansu
27th February 2002, 14:41
Alejandro & Mark

Thanks for the VB code it works fine. (I’m putting the name in a file and read it from three).
I’ll try to explain my problem.
We use Baan on Unix and we also have Novell NetWare installed.
The Baan User name is different then the Novell Client User name and what I’m trying to do is to get the
Novell User name.
Logname$ & getenv$() give me the Baan User name but the VB code you posted gives the Novell User Name.
My question is can get it without using VB ? Only from Baan script.

I hope that I explained my need.

Ilan S

alejandro
27th February 2002, 15:47
Well,

The only way I can Imagine to solve your problem is to make direct calls from BaaN to Windws API functions.

If anybody knows if this is possible, I want to know how too.

mark_h
27th February 2002, 16:29
On our clients we have an environment variable called IDNAME and USERID, both are the same. To get one of these you could do it all with Baan coding, but it is not pretty. It would look something like this:

(1) Create tmp file
(2) put in dos command to get variable - example:
echo %IDNAME%>c:\baan\tmp\idname.txt
(3) Download file to client as a .bat file
(4) Use app start to run the .bat file
(5) Use the seq.open.local to open file on the client
(6) Use seq.read.local to read the file.

This would work, but there has got to be a better way. My appologies for such an ugly solution, but it is the best I can come up with on the spur of the moment.

Good Luck!

Mark

Ilansu
27th February 2002, 17:34
Mark Hi

I tried the %IDNAME% and the %USERID% and it’s not working for me however
I did something different with batch file.

1) Create a *.bat file containing the command : set>c:\baan\username.txt
2) This file creates a list of parameters from the windows set table.
3) With the seq.open.local and seq.gets.local I search for the key word “USER=”
4) This line gives me the User name

Not the nieces solution but it works

Thanks for the help

Ilan S