If you’re a Systems Administrator or work on computers in any capacity in an enterprise environment, you may need to manage computers remotely. Learn the various methods to connect to a remote computer.
Overview
The method available to remotely manage a PC or server depends on the operating system. However, if you need to access a computer from another computer, you must meet two requirements:
- The PC must be configured to allow remote connection and management
- You must have the credentials that are permitted to access the computer remotely
Earlier, I mentioned that the method of remote connection depends on the operating system. Following up on that, if you need to remotely administer a Windows computer, you can use Remote Desktop (RDP), Computer Management, or PowerShell.
However, to connect to a Linux box, you can use SSH.
Let’s examine the details of these methods in the sections below.
Option 1: Remote to Windows Computer via RDP
Before you can use RDP to connect to a Windows computer:
- RDP must be enabled on the remote computer
- You must have a user that belongs to the remote computer’s administrators or Remote Desktop Users group
- The source computer must reach the remote computer via a network
If you meet these three requirements, follow the steps below to RDP to a remote computer:
- Search for and open Remote Desktop from the source computer.
- Then, when the RDP app opens, enter the name or IP address of the remote computer and click Connect. The remote computer will prompt you to enter a username and password.
- Enter the username with the permission to RDP to the computer. As shown in my screenshot below, Windows is attempting to connect with the credentials in my source computer but I want to use a different credential.
So, to enter a different credential, click “More choices.” After that, select “Use a different account.”
Finally, enter the account I want to use for the RDP connection and click OK.
- When you click OK, you’ll receive a certificate warning. Check the “Don’t ask me again for connections to this computer” checkbox and click Yes to continue the connection.
RDP will connect to the computer and you can work on it as if it were a local computer.
Option 2: Manage Windows Computers with Computer Management
If you need to work on a Windows computer remotely, another handy tool is Computer Management.
Follow these steps to connect to a Windows computer remotely via Computer Management.
- Right-click the Windows start menu and select Computer Management.
- When the tool opens, right-click Computer Management (Local) and select “Connect to another computer.”
- Finally, enter the name or IP address of the remote computer and click OK to connect.
To confirm that you’re connected to the remote computer, its name or IP address will now be displayed where “Local” was displayed. From now, you can perform tasks on the remote computer.
Option 3: Use PowerShell to Remote to a Windows Computer
PowerShell offers many cmdlets for remote connections. However, the two most common that I have used are the New-PSSession and Enter-PSSession.
The main difference between the two is that the New-PSSession command creates a persistent connection to a remote (or local) computer.
On the contrary, the Enter-PSSession command allows you to interactively manage a remote computer.
The terms “persistent” and “interactive” will become clearer in my examples in the subsections below.
In the following two subsections, I have explained the steps to use these two cmdlets for remote management.
Method 1: Use New-PSSession for Remote Management
Before connecting to a remote computer using the New-PSSession command, you must first enable WinRM on the computer.
If you need help enabling WinRM, read my article, How to Enable WinRM to Allow Remote PowerShell Management (link opens in a new tab).
Once you set up WinRM, open PowerShell as administrator, then follow these steps to remote to a Windows computer.
- Create a remote PowerShell session using the command below:
$Session = New-PSSession 192.168.0.58 -Credential (Get-Credential 192.168.0.58\victor)
- When you execute the command by pressing the Enter key, PowerShell will prompt you for the account’s password. Enter the password and click OK.
The above command creates a remote session and saves it in the $Session variable.
- Define the command to run in the remote session.
In this example, I want to create a folder called PSSession in drive C. To do this, I will create a script block with the New-Item command
$ScriptBlock = { New-Item -Path C:\Remote -ItemType Directory -Name PSSession}
- Finally, connect to that session using the Invoke-Command command.
Invoke-Command -Session $Session -ScriptBlock $ScriptBlock
If the command goes according to plan, PowerShell should connect to the remote computer and create the folder. Not only that, but it even tells you that it did!
I included a screenshot of the folder on the remote computer.
Method 2: Use Enter-PSSession for Remote Management
The steps for using the Enter-PSSession is like using the New-PSSession with one difference. Since the Enter-PSSession allows you to interactively execute commands on the remote computer, you DO NOT need to specify any command when you make the connection.
- So, the first step is to create a remote session with the Enter-PSSession. Here is a command I’m using for my demonstration.
$Session = Enter-PSSession 192.168.0.58 -Credential (Get-Credential 192.168.0.58\victor)
- Once you run the last command and authenticate by entering the password, PowerShell opens an interactive session to the remote computer.
You can confirm that you’re now on the remote computer because PowerShell displays the name or IP address – depending on how you connected.
From this point, you can run PowerShell commands as though you opened a local PowerShell console locally on the remote computer.
- In the last subsection, I created a folder called PSSession. I can use the command below to confirm that the folder exists.
Get-Item C:\Remote
And, it does!
Option 4: Remote to a Linux Computer with SSH
So far in this guide, I have given three examples showing how to make remote connections and manage Windows computers.
But, what about remotely managing Linux computers?
To make remote connections to a Linux computer, you use the SSH command. However, as I mentioned in the Overview section of this guide, the remote computer must be configured to allow connections via SSH.
Secondly, you must have the credentials with permission to connect to the remote Linux computer.
When you’re ready, run the command below to remote to the Linux computer.
ssh [email protected]
When you execute the command by pressing the enter key, the shell will prompt you for the password to the account you specified.
Once you authenticate successfully, you’ll be logged in to the destination Linux computer!
From this point, you can run commands (based on your account’s permissions) on the remote computer.
Conclusion
Systems administrators need efficient ways to manage multiple computers. Fortunately, both Windows and Linux computers have methods you can use to remotely administer them.
In this guide, I shared two GUI methods you can use to manage Windows computers remotely. In addition to the GUI methods, I discussed how to manage Windows computers using PowerShell remoting capabilities.
The guide did not leave Linux admins out in the cold!
It also covered the steps to use SSH to remote to a Linux computer.
I am confident that this step-by-step guide meets your needs. Let me know by clicking Yes to the “Was this page helpful?” question below.
Before you run, why not browse our Technology how-to guides page for more exciting hands-on how-to guides?