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

  • Coozie - Tuesday, January 15, 2019 11:19 AM

    Thanks for the reply, Jeff.  This is just a simulation where I'm using a dummy account on a test server and was tired of typing the pwd.  I can't imagine anyone actually thinking that this would be the right thing to do. 

    Having said that, do you have any suggestions or help on the actual topic?

    Thanks,
    Mark

    You said you wanted to spawn the process as a different user and then hardcoded it with no explanation.  With that, I thought you were actually going to do such a thing.  And, no... I can't imagine anyone actually doing such a thing and, yet, they do.

    As for the actual topic, yes... I have an idea... why are you trying to get information about the computer using T-SQL.  Why not just make a WMIC call?  Also, why write something like this?  Why not just buy an existing product the would not only identify such things but also provide you with the ability to monitor the servers for other things?  Of course, you'll also take some exception to those questions because your post hasn't provided anyone with enough information to actually know what the end game here is and so I'm just guessing based on what I see in the code.

    .

    --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)