Launch IE as multiple users for testing

When testing role based security, it can be helpful to right click IE and “Run as different user.”   The below PowerShell script automates this process to make it easier to launch multiple IE windows for testing.   Keeping a copy on Windows 7/8 workstations can help users jump into testing easily and with fewer password typo lockouts.    If you find this helpful, please leave a comment.  Smile

 

# Launch multiple IE windows as different test user accounts.  Great for testing role based security systems.
# Updated line 3 with user name, line 6 with Active Directory domain, and line 9 with SharePoint URL.
$users = ('sptest1','sptest2','sptest3','sptest4')
foreach ($u in $users) {
	Write-Host $u
	$username = ('domain\' + $u)
	$password = 'pass@word1'
	$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
	Start-Process "c:\Program Files\Internet Explorer\iexplore.exe" -LoadUserProfile -Credential $cred -ArgumentList "http://sharepointUrlHere"
}

 

Here is a screenshot of the script in action.

1

6 Comments

  1. This is awesome, ah, I can’t wait to use it! Such a frustration, especially with SP2013… Wish I thought of this sooner 😉 Great job!

  2. It looks like this will work ok if the my machine is on the same domain as the users that are trying to run IE. Is it possible for it to work with users on a different domain? For example, I’m a consultant and my machine is on domain “MYCOMPANYDOMAIN” but the test user accounts are on the client’s domain of “CLIENTDOMAIN.” I’d really like to have this fire up the client’s SharePoint environment, and automatically “Sign in as different user” for each of the test user accounts.

  3. Great script, worked perfect for my companies intranet site which requires different accounts for different areas of the site. Thank you!!

Leave a Comment

Return to Top ▲Return to Top ▲