Options

how to get windows login

kgsinhakgsinha 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

  • Options
    mstallmannmstallmann 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*...
  • Options
    kgsinhakgsinha 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.
  • Options
    DenSterDenSter Member Posts: 8,304
    Table 2000000054 - Windows Login. It's all the way down the table list. Both the SID and the ID are fields in this table.
  • Options
    kgsinhakgsinha 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??
  • Options
    kinekine 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.
  • Options
    mstallmannmstallmann 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...
  • Options
    kgsinhakgsinha Member Posts: 67
    how can i access active directory.... and what should be the procedure to get ID
  • Options
    kinekine 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.
  • Options
    aavioaavio 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
  • Options
    kinekine Member Posts: 12,562
    What about Session table (field Login Type)? ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    aavioaavio 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
Sign In or Register to comment.