Converting UID to NTID

 3 Replies
 1 Subscribed to this topic
 27 Subscribed to this forum
Sort:
Author
Messages
JimY
Veteran Member
Posts: 510
Veteran Member

    I copied John's javascript to convert a UID to a NTID and I am not getting the correct NTID.  Instead of getting NT0000000e I am getting NT00000000.  I hard code the UID in the variable rqryUsers_UID.  Any thoughts on what I am doing wrong?  His flow is pulling the UID from resources.  Thank you.

     I can't seem to insert the sciprt without getting a bunch of formating.  Sorry/

    if(rqryUsers_UID=="")

      {sNTID="";}

    else

        {

        var j=rqryUsers_UID;

        var hexchars =  "0123456789abcdef";

        var hv = "";

        for (var i=0; i< 4; i++)

           {

            k = j & 15;

            hv = hexchars.charAt(k) + hv;

            j = j >> 4;

           }

        sNTID = "NT";

        for (var x = hv.length; x < 8; x++)

            { sNTID = sNTID + "0" };

             sNTID = sNTID + hv;

        }

     

    JimY
    Veteran Member
    Posts: 510
    Veteran Member
      Never mind. I was using the wrong value for UID. Thank you.
      keeline
      New Member
      Posts: 1
      New Member
        what value did you use for UID? I am having the same issues...
        JimY
        Veteran Member
        Posts: 510
        Veteran Member
          I was referencing the login instead of the UID which is the first value you see.