Options

get NAV Windows Login SID

elrobertoelroberto Member Posts: 11
Hi,

i'm searching for a way to get the navision SID for my windows login (with domain) by C/ALcode.

Can someone give me an example or some tips?

thx

Answers

  • Options
    deV.chdeV.ch Member Posts: 543
    in the "Windows Login" Table (2000000054) there's a column SID so you can get it from there. But if you are working with Groups instead of users then there is just a entry for a group and you can't find the current user.

    What do you want to do? Get the SID for the current User?
  • Options
    elrobertoelroberto Member Posts: 11
    yes.

    i want to get the SID for the current user.

    the problem is, that USERID returns "My Name" and for the Windows Login Table i need "DomainName\My Name".

    Is there a way to get the current domain? or can i only set a filter with the value of the USERID to get the user with domain in the Windows Login table?
  • Options
    deV.chdeV.ch Member Posts: 543
    Just look for the entry which contains USERID.
    SetFilter with '*%1',USERUID could work.
  • Options
    danlindstromdanlindstrom Member Posts: 130
    use also the sessiontable.

    like:
    Session.SETRANGE("My Session",TRUE);
    Session.FIND
    "Windows Login".SETRANGE(ID,Session."User ID");
    "Windows Login".FIND
    EXIT("Windows Login".SID)
    Regards
    Dan Lindström
    NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
    MBSP Developer for Microsoft Dynamics NAV 2009
  • Options
    elrobertoelroberto Member Posts: 11
    thank you.

    both works fine, but i chose the solution of danlindstrom. i think its more secure :)
Sign In or Register to comment.