For example, you can use the following "PP_Test_ImpersonateSuperUser.bat" file to impersonate a Super User without logging off and logging in as that user. It will also open up IE for the http://pp-test web site (an intranet site).
@ECHO ******Running as SUPER USER (IMTEST11); password is SuperUsersPassWord
@ECHO OFF
COLOR 0A
runas /user:APAC\imtest11 /savecred "%ProgramFiles%/Internet Explorer/iexplore.exe \"pp-test\""
pause
You can now test to your hearts content without having to log off your normal Windows account or logging on into Terminal Services on another machine as a different user.
4 comments:
it would be really great if you could expand on this. ie explain why you need a superUserPassword in the first place etc. Many people like myself are mystified right now in how to support our windows authentication asp.net apps.
I am desperately trying to find a methood that will allow my support people to open a batch file, enter the caller's username, enter their pass, and launch a session as that user. that would be fantastic.
you know.. in your spare time of course.
Hi Mac. We are using Windows authentication and WindowsTokenRoleProvider in our application. User's roles consequently are based on their active directory groups. We don't want to have to go to active directory and constantly change our group membership in Active Directory as we are testing different parts of the application as different users (it typically takes 24 hours for support to change active directory membership). It is much simpler for us to log in as a user who has predefined roles (e.g. "SuperUser", "FundManagerUser") so we can test accessibility and visibility of role-specific functionality.
The batch file I've provided does exactly as you say. I just run a batch file and it opens up the application as the impersonated user (e.g. "FundManagerUser"). It even caches the password after it has been entered once - so it becomes a one click operation to impersonate different users.
hi. thanks for the feedback and ideas. I will be implementing this idea into my online application in the same manner.
cheers.
Perfect! Just what I wanted for testing our web apps!
Post a Comment