locked
Override Windows authentication in IE RRS feed

  • Question

  • Hi - I have a web application that uses IIS Windows authentication to automatically log the user in. 

    I have some users who need to access the application as another user so would like a script that requests the user to log in to IE as the other user then open the web application as that user and NOT the user they are logged into Windows as.

    It is not feasible to do this as a Run As because I need to activate the script from a button on the users dashboard.

    Hopefully someone can assist.

    Cheers

    H

    Wednesday, June 28, 2017 4:01 PM

All replies

  • I use Windows Authentication, and if I do not have permissions to a site, then IE automatically gives me a logon box to supply credentials.

    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''

    Wednesday, June 28, 2017 5:12 PM
  • You cannot do this without using "RunAs" in some form.

     start-process 'C:\Program Files\Internet Explorer\iexplore.exe' -RunAs alpha\localtest

    or

    start-process 'C:\Program Files\Internet Explorer\iexplore.exe' -Credential $cred


    \_(ツ)_/

    Wednesday, June 28, 2017 5:28 PM
  • You cannot do this without using "RunAs" in some form.

     start-process 'C:\Program Files\Internet Explorer\iexplore.exe' -RunAs alpha\localtest

    or

    start-process 'C:\Program Files\Internet Explorer\iexplore.exe' -Credential $cred


    \_(ツ)_/

    jrv,

    I tried start-process 'C:\Program Files\Internet Explorer\iexplore.exe' -Credential (Get-Credential -Message "Username/Password")

    And if failed saying my credentials are wrong, even though they are not, so don't think that is going to work

    PS S:\Scripts\Powershell> Start-Process "C:\Program Files\Internet Explorer\iexplore.exe" -Credential (Get-Credential -Message "E
    nter Username/Password")
    Start-Process : This command cannot be run due to the error: The user name or password is incorrect.
    At line:1 char:1
    + Start-Process "C:\Program Files\Internet Explorer\iexplore.exe" -Cred ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
        + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand


    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''

    Wednesday, June 28, 2017 5:58 PM
  • Works fine for me.  You have to be sure to use good credentials.  The error is pretty clear.

    Use the "RunAs" version it will prompt for the password.

    Group Policy can restrict this capability.


    \_(ツ)_/


    • Edited by jrv Wednesday, June 28, 2017 6:03 PM
    Wednesday, June 28, 2017 6:02 PM
  • Ahhhh, I figured out what I was doing wrong....just supplying username and password, have to supply username as domain\username or username@domain :-D

    But then got a directory error, which I fixed by using the -WorkingDirectory parameter


    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''


    • Edited by clayman2 Wednesday, June 28, 2017 6:21 PM typo
    • Proposed as answer by Hello_2018 Thursday, June 29, 2017 8:38 AM
    Wednesday, June 28, 2017 6:08 PM