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
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
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
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.
I need to connect to a virtual machine and change its network address. Is it possible to do it using Invoke-Command?
Thanks.
Yes this is possible to do but note that when changing the IP address of a remote computer it might become unresponsive.
Unless the VM has multiple NICs, or multiple IP addresses assigned to a single NIC, and you change the IP address of the NIC you're connected to, you'll be disconnected. You very likely won't see the results of the change in the disconnected session, and until the NIC is "reoriented" in DNS (which you'll have to do), NetBIOS, switches, etc. the machine probably will act like it's offline. Eventually the machine will reappear.
17 people are following this question.