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

  • $UserName = 'DOMAIN\DifferentUser'
    $PlainPassword = 'StrongPassword'

    The snippet of code above is from the code you posted.  I'm no ninja at PowerShell but that code seems to imply that the user name and password will exist in clear text, which is a serious violation of all that is holy when it comes to security.

    If what I've stated is correct, my recommendation would be to learn how to correctly use Active Directory for such things.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)