Page 1 of 2

Network questions

PostPosted: Tue Aug 18, 2009 11:01 am
by Loach
Hello!
Does anybody know the answers on this two questions:
1. How can I get my current login in Novell Netware ( something like function WNetGetUser() for Win )
2. Function GetIP() on my PC returns "0.0.0.0", but I have the static IP in my XP system. What I do wrong?

Thank's a lot.

Re: Network questions

PostPosted: Tue Aug 18, 2009 11:42 am
by anserkk
1. How can I get my current login in Novell Netware ( something like function WNetGetUser() for Win )

Did you try the command "WhoAmi"

Regards
Anser

Re: Network questions

PostPosted: Tue Aug 18, 2009 12:25 pm
by Loach
Hello, Anser!
Thank you, but I can't find the command "WhoAmi" in FWH, xHarbour or OS Windows and Novell NetWare :(
May be it's only for Linux...
Have you some example of usage this command?

Re: Network questions

PostPosted: Tue Aug 18, 2009 1:23 pm
by Gale FORd
Try netname( .t. )

Re: Network questions

PostPosted: Tue Aug 18, 2009 1:34 pm
by Loach
Try netname( .t. )

Thank's. But "netname" is return the name of current Windows User...

Re: Network questions

PostPosted: Tue Aug 18, 2009 1:48 pm
by Gale FORd
Wouldn't the user name be the same? If you are not using the integrated log in then how about netbios.sys. Novell NetWare Requester provides a NetBIOS driver (NETBIOS.SYS) that emulates the NetBIOS protocol so netname( .t. ) should return correct network name.

Re: Network questions

PostPosted: Tue Aug 18, 2009 3:09 pm
by Rick Lipkin
WnetGetUser() has always worked for me in both Novell and Microsoft networks .. NetName(.t.) works as well

Rick Lipkin

Re: Network questions

PostPosted: Tue Aug 18, 2009 8:01 pm
by StefanHaupt
Hello,

Loach wrote:Does anybody know the answers on this two questions:
1. How can I get my current login in Novell Netware ( something like function WNetGetUser() for Win )


For clipper there was a lib called "netto", which has all functions especially for novell. It should be possible to adapt the functions to xHarbour. If you are interested, I can send it to you.

Re: Network questions

PostPosted: Wed Aug 19, 2009 5:50 am
by Loach
Hi!
Wouldn't the user name be the same

In our network (more than 500 pc) each user have the unique Novell name, but in OS Windows everybody have only "Admin" and "User" records. Than, if you have the same passwords (in Novell and Windows) after the Novell password inputing, Windows registration comes automaticly.
WnetGetUser() has always worked for me in both Novell and Microsoft networks .. NetName(.t.) works as well

In my case WnetGetUser() and NetName(.t.) returns "User" instead of my Novell name...
For clipper there was a lib called "netto", which has all functions especially for novell. It should be possible to adapt the functions to xHarbour. If you are interested, I can send it to you.

Thank you so much! If it's possible, send it on Loach(at)mail.ru.

Re: Network questions

PostPosted: Wed Aug 19, 2009 2:02 pm
by Gale FORd
Netname() requires netbios to be turned on. You have to have either have NETBIOS.SYS for Netware Requester or in Windows have netbeui turned on.

Re: Network questions

PostPosted: Wed Aug 19, 2009 2:19 pm
by Loach
You have to have either have NETBIOS.SYS for Netware Requester

I have NETBIOS.SYS in windows\system32\drivers

in Windows have netbeui turned on.

Image
Do you mean this flag in network connection properties?

Re: Network questions

PostPosted: Wed Aug 19, 2009 6:48 pm
by Gale FORd
Sorry it has been a while since we moved from Netware. I would have to do some more checking to find out why the netname() function is not working right. Here is another idea, I remember the Netware login script used to set an evironment variable "UserName". Click "Start" then "Run" and enter "cmd" in box and press enter. Type "Set" into cmd window and press enter. You should see one of them have the user name. Then use gete("User Name Var").

Re: Network questions

PostPosted: Wed Aug 19, 2009 7:59 pm
by Rick Lipkin
There is a netware 3rd party 'legacy' clipper and 32 bit .dll from Blinker ( blinkink.com ) called 'NovLib' .. it is specifically for Novell networks. It is a legacy product and did work 'somewhat' in a NDS\eDir environment. When Novell went away from the 3x environment to 4x and beyond .. we found syncronizing the user profile ( desktop ) using ( novell ) Zenworks ( dynamic local user ) solved all the problems .. that way WNetGetUser() would work because the user profile and the user login were the same.

Rick

Re: Network questions

PostPosted: Thu Aug 20, 2009 6:18 am
by Loach
the Netware login script used to set an evironment variable "UserName"

Great idea!!! I even didn't think about it!!! It's all work well. There are two the same variables I need: NWUSERNAME and USERLOGINNAME.
Also I found it in Windows register: HKEY_CURRENT_USER\Volatile Environment.
So, many thank's for everybody!!!

Re: Network questions

PostPosted: Thu Aug 20, 2009 6:29 pm
by Rick Lipkin
Loach

I work for a VERY large State Agency ( over 5000 users and desktops ) and we used to be a Novell shop .. When I used Novlib to interogate the Novell environment it was very specific to Novell .. and guess what .. we changed from Novell to Microsoft .. which made all the Novell specific libraries useless.

Just be mindfull that 'best practice' for any network ( I am also a network admin for 400 local people ) is to have the users profile made the same as the network id .. I just can not imagine why such a 500 user customer like yours would chose to sync a desktop the local Admin .. very dangerious and a lazy practice .. If they are a Novell shop they need to be using zenworks to manage their desktops with dynamic local user enforced .. that way ( like microsoft ) when anyone logs into a worstation .. their profile is created ( dynamically ) on the local box to match their login username on the network ..

Then WNetGetUser() will work in both network environments .. and you don't have to do anything special .. no environmental variables or special network specific software.

Just my 2 cents there .. I realize you are not in any position to make suggestions to your customer.

Rick Lipkin