How to create a shortcut to run an application as a different user by PowerShell

This sample demonstrates how to create a shortcut to run an application as a different user

 
 
 
 
 
5 Star
(1)
581 times
Add to favorites
12/22/2016
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • Script does nothing - Any clues?
    1 Posts | Last post January 23, 2017
    • Two Issues:
      
      (1)
      "Get-Help CreateShortcutRunAsDiffUser –Full" doesn't output anything as mentioned in Script > Step 2 (Description)
      
      (2)
      When run as instructed, nothing happens. No shortcuts created. Debugged line by line and found "$Shortcut.Save()" doesn't do anything.
      
      I have PoSH 5 on Win 10
  • Is it wise to use this?
    2 Posts | Last post December 16, 2016
    • Bad example imho. $a is set, but serves no purpose.
      And runas /savecred does store the credentials of the other user under the current user's profile. Do you really want to do that if either account is not yours?
    • Hi,
      
      The code in archive is correct, but the author forgets to remove the unnecessary $a variable in the code snippet of this article. Now we have updated it. Thanks for your reminder.
      
      And for the storing the credentials, yes this is real requirements of users. They often have several test accounts and want to mimic them in their primary account environment. This sample addresses this problem.