PsExec and PS.

Doria 1,246 Reputation points
2021-08-09T17:39:34.86+00:00

Hi everyone!

Can I open a system prompt remote shell like we do with the PsExec tool using PS?

Hope I was clear enough.

Thanks.
Doria

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Leon Laude 86,026 Reputation points
    2021-08-09T17:47:13.64+00:00

    Hi @Doria ,

    Not sure I fully understood you, do you want to run a PowerShell as the local SYSTEM user?

    If this is the case you can do it with the help of both PS and PSExec:
    https://powershell-guru.com/powershell-tip-53-run-powershell-as-system/

    ----------

    If the reply was helpful please don't forget to upvote and/or accept as answer, thank you!

    Best regards,
    Leon


  2. Rich Matheisen 47,901 Reputation points
    2021-08-09T18:06:25.5+00:00

    You can create a PowerShell "session". New-PSSession and Enter-PSSession are the cmdlets to use from the local machine. You'd then be able to use the cmdlets on your local machine to effect changes on the remote machine. If you don't have the PowerShell modules on the local machine you can use Import-PSSession and run the module code on the remote machine on your local machine.

    If you don't actually need the shell, you can use Invoke-Command from the local machine to run scripts on the local (or another remote) system on target machine.

    0 comments No comments

  3. Doria 1,246 Reputation points
    2021-08-09T19:05:20.887+00:00

    I need to connect to a virtual machine and change its network address. Is it possible to do it using Invoke-Command?

    Thanks.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.