Skip to main content
Inspiring
August 28, 2008
Question

Nt username

  • August 28, 2008
  • 25 replies
  • 2497 views
How to get nt username using CF? Please anyone, thanks....
    This topic has been closed for replies.

    25 replies

    Inspiring
    September 2, 2008
    emmim44 wrote:
    > <cfexecute name="u" arguments="C:/cmd echo %username%"></cfexecute>

    No, I suspect that will give the user name ColdFusion is running under,
    if anything at all.

    Is this over a well defined intranet or are you trying something over
    the entire world wide web internet?

    On a well defined intranet where the systems can see each other there is
    some type of net state utility that can give some details from a
    computer with the IP address, which can be found in the CGI scope. At
    least there is on a Windows machine and network.

    I know I once used this to have a intranet web page show the machine
    name of a logged in user to aid our help desk. The ColdFusion code used
    <cfexecute...> to run a DOS command that retrieved the machine name
    across the corporate's Windows network. They could ask Mary Jane Von
    Der Longname to look in the corner of the intranet home page to find out
    their machine name easily and quickly.

    Since otherwise only 1% of the users would know this without detailed,
    step-by-step, walk-through instructions. And many of the remaining 99%
    would still fail even with such instructions.
    emmim44Author
    Inspiring
    September 2, 2008
    <cfexecute name="u" arguments="C:/cmd echo %username%"></cfexecute>

    I dont think that will work... One thing I am afraid is it might not give the username of the client who execute my page...
    tclaremont
    Inspiring
    September 2, 2008
    If the suggestions provided so far are not working for you, then I suspect that the problem is between the keyboard and the chair.
    Inspiring
    September 2, 2008
    try harder.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    emmim44Author
    Inspiring
    September 2, 2008
    It is not a good help so far...
    BKBK
    Community Expert
    Community Expert
    August 30, 2008
    I see now that you want Coldfusion to give you a Windows username. My suggestion is indeed of little use to you. Coldfusion is only aware of usernames that were logged in within a Coldfusion context.

    You should do it in a Windows context. Ian Skinner's cfexecute suggestion would then be, in my opinion, the best method.


    BKBK
    Community Expert
    Community Expert
    August 29, 2008
    How to get nt username using CF?

    <cfNTauthenticate>, then cfntauthenticate.username or result.username

    emmim44Author
    Inspiring
    August 29, 2008
    That requires an username and password, and I am looking to retrieve the nt username of a client whoever runs my page....You are not clear BKBK
    Inspiring
    August 28, 2008
    emmim44 wrote:
    > And that path would be ???

    Whatever executable you are trying to run on your server.
    emmim44Author
    Inspiring
    August 28, 2008
    And that path would be ???
    Inspiring
    August 28, 2008
    emmim44 wrote:
    > I am trying to execute this '<cfexecute name="u" arguments="echo %username%"></cfexecute>


    ColdFusion does not have a PATH environment variable that allows it to
    just give the command. You have to provide the fully qualified path to
    the 'echo' executable.