Home Forums Programming Powershell Run New PowerShell Process As A Different User RE: Run New PowerShell Process As A Different User

  • not sure if this helps.
    Fore security reasons, i never log in as my elevated account, but as a regular account,and spawn applications with the privileged account as needed. via a simple cmd/bat file:
    the advantage is i have saved my credentials the first time it runs, and just have to update when it's time to change password

    for example, to start the PowerShell IDE, i have a *.cmd file with one of the various commands below in it, as examples:
    Explorer++.cmd:
    runas /savecred /user:mydomain\super.admin.lowell "C:\_Apps\Explorer++\Explorer++.exe"
    PowerShell.cmd
    runas /savecred /user:mydomain\super.admin.lowell "%windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe"

    Bids2008.cmd
    runas /savecred /user:mydomain\super.admin.lowell  "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe"

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!