Return their Log In ID? - InfoPath Dev
in

InfoPath Dev

Return their Log In ID?

Last post 02-05-2007 08:24 PM by dpsavy. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 06-30-2006 06:32 AM

    • davers
    • Not Ranked
    • Joined on 06-26-2006
    • USA
    • Posts 15

    Return their Log In ID?

    Hi everyone. I have a form hooked up to a Web Service which can look up employee information. The field I query on is the log Id that they log into their computers with. Is there a way to automatically fill this in? Can InfoPath get that information from the system so the user doesn't have to enter it manually?

    Thanks,

    Dave
  • 06-30-2006 10:03 AM In reply to

    Re: Return their Log In ID?

    Hello Davers

    Yes you can do this in Infopath
    There are lots of posts which have discussed this issue earlier
    just try searching the forums by inserting Keyword Username, Pouplateusername etc.
    you will find a lot of posts and can pick one that suits your need
    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 06-30-2006 08:50 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Return their Log In ID?

    Check out this links to get more information,

    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=2227

    http://www.infopathdev.com/howto/tutorials/default.aspx?i=06d94826ac7a46a09a0f68238c2e0769

  • 07-06-2006 08:29 AM In reply to

    Re: Return their Log In ID?

    Another method that may be simpler, which I have used, is to leverage the form library of the form in Sharepoint. Onload submit to a data connection that saves a blank copy of the form with a specific filename. Then Query another data connections that returns the contents of the form library with a filter for the specific file name. I use the default modified by field to get the user's display name. I then use it as a lookup in a database.
    You can delete the file but I don't bother since it is blank and the same form gets reused everytime the form is opened. You can modify the view filter where as people would not see it as well.
  • 07-06-2006 09:09 PM In reply to

    Re: Return their Log In ID?

    I do my programming in vb.net.

    I use System.Environment.UserName.

    Dim strName as String
    strName = System.Environment.UserName

    That's it.
  • 02-05-2007 05:44 PM In reply to

    Re: Return their Log In ID?

    quote:
    Originally posted by clayfox

    Another method that may be simpler, which I have used, is to leverage the form library of the form in Sharepoint. Onload submit to a data connection that saves a blank copy of the form with a specific filename. Then Query another data connections that returns the contents of the form library with a filter for the specific file name. I use the default modified by field to get the user's display name. I then use it as a lookup in a database.
    You can delete the file but I don't bother since it is blank and the same form gets reused everytime the form is opened. You can modify the view filter where as people would not see it as well.



    I'm interested in how to accomplish this. Can someone walk me through it please?
  • 02-05-2007 08:24 PM In reply to

    • dpsavy
    • Not Ranked
    • Joined on 01-26-2007
    • USA
    • Posts 13

    Re: Return their Log In ID?

    Here is the method I use for querying LDAP for all sorts of useful info, such as username. Written in VBScript (sorry I'm not proficient at Javascript).


    Dim txtLogon

    'set the variables
    Set objRootDSE = GetObject("LDAP://rootDSE")
    Set objSysInfo = CreateObject("ADSystemInfo")
    Set objUser = GetObject("LDAP://" & objSysInfo.UserName)

    'Use this when your users logon via a smartcard or by means
    'other than username and password.
    txtLogon = objUser.Get("sAMAccountName") 'Logon Name (pre-Windows 2000)

    'Use this when your users logon via username and password. (most common)
    txtLogon = objUser.Get("userPrincipalName")


    Bonus: Here is a great reference guide to Active Directory. http://www.kouti.com/tables/userattributes.htm
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.