title: PowerShell script to launch 4 IE windows using different AD account credentials
body: <p>Why won't this simple PowerShell script launch 4 IE windows using different AD account credentials which are embedded into the script?</p>
  
  <pre><code>$users = ('testaccount1','testaccount2','testaccount3','testaccount4')
  $password = 'password'    
  foreach ($user in $users) {
      $username = ('domainname\' + $user)
      Write-Host $username
      $cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
      Start-Process -FilePath "c:\Program Files\Internet Explorer\iexplore.exe" -LoadUserProfile -Credential $cred -ArgumentList "http://websiteaddress.com"
  }
  </code></pre>
  
  <p>When I run it, I get this error, but the IE file path is correct:</p>
  
  <pre><code>domainname\testaccount1
  Start-Process : This command cannot be run due to the error: The directory name is invalid.
  At C:\Users\username\Downloads\Launch IE as multiple users for testing.ps1:12 char:2
  +     Start-Process -FilePath "c:\Program Files\Internet Explorer\iexplore.exe" -Load     ...
  +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
  + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
  </code></pre>
  
  <p>Can someone please explain why the above script gives this error?  I'm using PowerShell 3.</p>
  
  <p>Note: this line will launch IE &amp; go to the specified website URL so I know the IE file path &amp; directory name is valid:</p>
  
  <pre><code>Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe " "http://www.google.com"
  </code></pre>