I recently had to start managing remote Windows 10 systems (non-servers) and am curious if there is an SSH equivalent for running command prompt commands remotely.
Is there a default utility for doing this?
I recently had to start managing remote Windows 10 systems (non-servers) and am curious if there is an SSH equivalent for running command prompt commands remotely.
Is there a default utility for doing this?
The comments mention windows builds of SSH, but the actual equivalent for managing windows systems from windows is Powershell sessions. Here's a few good starting points:
Enable-PSRemoting
: Configures a PC to accept PS Sessions: Opens a firewall port, verifies the service is running, etc.
Enter-PSSession
is the equivalent to a normal ssh
command. It connects to the remote machine, starts a Powershell prompt, and streams it back to your terminal:
Enter-PSSession Win10PC
# Equivalent to
ssh MyUsername@Win10PC
# Prompt will look like this to show you're in the remote PC:
[Win10PC]: PS C:\WINDOWS\system32>
Invoke-Command
uses the same remote session process, but just runs the command you give it and sends you the result (better for scripts):
Invoke-Command -ComputerName Win10PC -ScriptBlock {Get-PSDrive}
Like SSH, Powershell will use the current user to connect to the remote machine, and run as admin if possible. To run as a different user, add the -Credential
flag
Enter-PSSession Win10PC -Credential (Get-Credential)
This doesn't require that you be in a windows domain, but it will work a lot better if you are.