how to get windows login

kgsinha
kgsinha Member Posts: 67
I am using SQL with navision.
and doing login into navision with Windows Login..
how do i get login id (through coding) after login.

It is easy to get database login using coding .,, but how to do with windows login??

Comments

  • mstallmann
    mstallmann Member Posts: 138
    USERID will return the windows login name as well. However it will strip out the domain. If you need the domain, you can lookup the windows login table by filtering for *USERID*...
  • kgsinha
    kgsinha Member Posts: 67
    Where does the windows login ID get stored (that is the user ID and not the SID) in navision (that is in any table) on the client and if not how can i retrieve a list of the windows login ID in navision.
  • DenSter
    DenSter Member Posts: 8,307
    Table 2000000054 - Windows Login. It's all the way down the table list. Both the SID and the ID are fields in this table.
  • kgsinha
    kgsinha Member Posts: 67
    OK i got it...
    but the problem is...
    When login with server, It contains the Login ID (actual Login) into the ID field of this table, But when i login with Client, In this table ID filed contains the same as of SID.

    Now i want to login as a client with windows login, and fetch the Login Id, what should be the procedure??
  • kine
    kine Member Posts: 12,562
    You see SIDs if you are not connected to Active Directory (working off-line etc.).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • mstallmann
    mstallmann Member Posts: 138
    run calcfield in the code on that field and it will return the domain with the username if you are able to query active directory...
  • kgsinha
    kgsinha Member Posts: 67
    how can i access active directory.... and what should be the procedure to get ID
  • kine
    kine Member Posts: 12,562
    Look at the Virtual Tables in NAV (search this forum for more info).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • aavio
    aavio Member Posts: 143
    Hai all
    Thanks for all your posting... =D>

    But How can i find whether the current user has been logged in with windows login or database login??? #-o
    aav!o
  • kine
    kine Member Posts: 12,562
    What about Session table (field Login Type)? ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • aavio
    aavio Member Posts: 143
    Yea, login type is there but in user id field(session tabl), its not displaying current users....

    i had logged in with 3 user id, in database information, session count is shown correctly...but in session table, user id seems to be just 'sa' :| ](*,)
    aav!o