How to read user's Novell Login name 
Author Message
 How to read user's Novell Login name

We are writing a 4.0 VB application for use on a Novell 4.1 network, in which
we would like to automatically enter a user's Novell login name in a form (for
security as well as convenience).

This app will be running in Windows 95 and Windows NT.

Can anyone offer some guidance?  Spawning a DOS shell to run WHOAMI is not
feasible.

Thanks,

Bill Le May



Sat, 20 Mar 1999 03:00:00 GMT  
 How to read user's Novell Login name


: We are writing a 4.0 VB application for use on a Novell 4.1 network, in which
: we would like to automatically enter a user's Novell login name in a form (for
: security as well as convenience).

: This app will be running in Windows 95 and Windows NT.

: Can anyone offer some guidance?  Spawning a DOS shell to run WHOAMI is not
: feasible.

Call Novell and ask for their Developer's Resource stuff.  They have a
complete API for this stuff.

Will.



Sun, 21 Mar 1999 03:00:00 GMT  
 How to read user's Novell Login name


Quote:

> We are writing a 4.0 VB application for use on a Novell 4.1 network, in
which
> we would like to automatically enter a user's Novell login name in a
form (for
> security as well as convenience).

> This app will be running in Windows 95 and Windows NT.

> Can anyone offer some guidance?  Spawning a DOS shell to run WHOAMI is
not
> feasible.

> Thanks,

> Bill Le May


Try this:

Declare Function GetConnectionNumber Lib "NWNetAPI.dll" () As Long
Declare Function GetConnectionInformation Lib "NWNetAPI.dll" (ByVal
lConnectionNumber As Long, ByVal sObjectName As String, iObjectType As
Integer, lObjectID As Long, LoginTime As Date_and_Time) As Integer

Private Function sGetUserID() As String

    Dim lConnectionNum As Long
    Dim sNetName As String * 48
    Dim iNetType As Integer
    Dim lNetID As Long
    Dim LogTime As Date_and_Time
    Dim iReturnCode As Integer

    gsErrProcedureName = "sGetUserID"
    sGetUserID = ""

    On Error GoTo errGetNetName
        lConnectionNum = GetConnectionNumber()

        If lConnectionNum Then
            iReturnCode = GetConnectionInformation(lConnectionNum,
sNetName, iNetType, lNetID, LogTime)
            If iReturnCode = 0 Then
                sGetUserID = Left(sNetName, InStr(sNetName, Chr(0)) - 1)
            End If
        End If
    On Error GoTo 0
    Exit Function

errGetNetName:
    sGetUserID = ""
    Exit Function

End Function

txtLoginName.Text = sGetUserID()

Goodluck,
Markus



Tue, 23 Mar 1999 03:00:00 GMT  
 How to read user's Novell Login name


Quote:
>We are writing a 4.0 VB application for use on a Novell 4.1 network, in which
>we would like to automatically enter a user's Novell login name in a form (for
>security as well as convenience).

Your login script doesn't put the user name into an environment variable?
That was how we did it back when the earth was young, dinosaurs ruled the
land, and we needed to make network environment information available to
applications.  Then you can just use the Environ() variable to retrieve it.

Or you can figure out how to do a Netware API call, as has been otherwise
suggested.

Bob Rossney



Tue, 23 Mar 1999 03:00:00 GMT  
 How to read user's Novell Login name

Declare these
Declare Function NWGetPrimaryConnectionID Lib "NWCALLS.DLL" (conn As
Integer) As Integer
Declare Function NWGetConnectionNumber Lib "NWCALLS.DLL" (ByVal conn As
Integer, connNumber As Integer) As Integer
Declare Function NWGetConnectionInformation Lib "NWCALLS.DLL" (ByVal conn
As Integer, ByVal connNumber As Integer, ByVal objectName As String,
objectType As Integer, objectID As Long, loginTime As LOGIN_TIME) As
Integer

Then this will return the login id in BanUser

    Dim conn As Integer
    Dim ccode As Integer
    Dim connNumber As Integer
    Dim MyName As String * 50
    Dim ObjType As Integer
    Dim ObjId As Long
    Dim LTime As LOGIN_TIME

    ccode = NWGetPrimaryConnectionID(conn)
    ccode = NWGetConnectionNumber(conn, connNumber)
    ccode = NWGetConnectionInformation(conn, connNumber, MyName, ObjType,
ObjId, LTime)
    BanUser = Left$(MyName, (InStr(MyName, Chr$(0)) - 1))

Dont use the env variable...too easy to hack and if it doesn't get set for
some reason you cant read it.



Quote:

> >We are writing a 4.0 VB application for use on a Novell 4.1 network, in
which
> >we would like to automatically enter a user's Novell login name in a
form (for
> >security as well as convenience).



Thu, 25 Mar 1999 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. How to read user's Novell Login name

2. Get Novell 4 user login name thru VB

3. User's login name...

4. Returning users' login name

5. Novell Login Names

6. Novell login name

7. Novell Login Name

8. How to get Novell login name

9. ASP/Need to Access Novell login Name

10. Login Name in a Novell Netware 3.11

11. LDB Viewer -- Need to get NT user login name in addition to computer name

12. Login failed for user 'XYZ1492\IUSR_XYZ1492'

 

 
Powered by phpBB® Forum Software