oray
  • Products
  • Downloads
  • Resources
  • Explore
  • Partners
  • Pricing
Products
  • AweSun Remote Desktop Control
  • AweSeed Intelligente Networking
  • AweShell NAT Traversal Expert
Downloads
  • AweSun Personal Edition
  • AweSeed Client
  • AweShell Client
Resources
  • Resources
Explore
  • Redeem Code
  • About Us
Partners
  • Partners
Pricing
  • AweSun Personal Plan
  • AweSeed Business Plan
  • AweShell Personal Plan
  • AweShell Business Plan
more
i18n
en
arrow
AI-translated page. Original content available in English.
Contact Us
Smart Hardware

AweSun

  • AweSun
  • AweSeed
  • AweShell
Search for this product
Search all.
  • Search all documents

Quick Start

Individual User

How do I initiate Remote Assistance with an identification code?

Unattended access your computer

What is a channel connection

Awesun Safety Remote Control Tutorial

Operation Help

software application

computer end application

How to Remote Files on Computer

Privacy screen

Handle Mapping

Multi-screen control Multi-screen

Intelligent hardware

Boot Hardware

Power-on socket/patch panel FAQ

Remote control without network

Resolution and refresh frequency supported by intelligent remote control devices

Common problems of intelligent remote control equipment

Software Manual

Windows

Windows personal edition manual

Android & iOS

Control terminal iOS version manual

User Manual of AweSun Host for Android

Intelligent hardware

Other

Intelligent remote control mouse (Bluetooth version) manual

Power on socket C2 manual

Case Center

Scenario Case

Telecommuting

Awesun Helps Huawei Improve Collaboration Efficiency

Industry case

IT Internet

How do well-known game manufacturers build internal remote assistance systems with the help of Aweray Awesun?

Smart Transportation

Soft and hard integrated solution to build intranet operation and maintenance, Aweray Awesun privatization deployment empowers Zhejiang Zhongche.

Intelligent Manufacturing

How to build an efficient cross-border remote technical support system when the manufacturing industry is out to sea?

Solution

IT Operation and Maintenance

Support ZTE's new fulcrum server operating system to Aweray the localization of Awesun empowerment.

How can enterprises quickly build a remote IT operation and maintenance system to deal with holiday business?

How does the first-line commercial equipment operate efficiently? Starting from these four aspects

Tips for remote IT management: How to group a large number of IT equipment? How to set up fast grouping?

To deal with the four major problems of chain operation and maintenance, Aweray Awesun IT operation and maintenance solutions to empower the chain retail industry.

Telecommuting

Deal with these three pain points, 'painless' to build enterprise telecommuting system

The Dragon Boat Festival holiday business is not interrupted, and the enterprise telecommuting plan is deployed in three steps.

After the telecommuting system is set up, how to manage IT assets in an enterprise in a unified way?

Technical Support

No longer piecemeal, how do enterprises build platform-based technical support services?

Efficient assistance, professional image, customer-oriented! Three aspects to build enterprise technical support professional reputation

How to ensure the security of remote control business? Analysis of the "whole process safety closed loop" system of Aweray Awesun

 


Cancel

Back to Home Page

Quick Start

 

Individual User

 

How do I initiate Remote Assistance with an identification code?

 

Unattended access your computer

 

What is a channel connection

 

Awesun Safety Remote Control Tutorial

 

Operation Help

 

software application

 

computer end application

 

How to Remote Files on Computer

 

Privacy screen

 

Handle Mapping

 

Multi-screen control Multi-screen

 

Intelligent hardware

 

Boot Hardware

 

Power-on socket/patch panel FAQ

 

Remote control without network

 

Resolution and refresh frequency supported by intelligent remote control devices

 

Common problems of intelligent remote control equipment

 

Software Manual

 

Windows

 

Windows personal edition manual

 

Android & iOS

 

Control terminal iOS version manual

 

User Manual of AweSun Host for Android

 

Intelligent hardware

 

Other

 

Intelligent remote control mouse (Bluetooth version) manual

 

Power on socket C2 manual

 

Case Center

 

Scenario Case

 

Telecommuting

 

Awesun Helps Huawei Improve Collaboration Efficiency

 

Industry case

 

IT Internet

 

How do well-known game manufacturers build internal remote assistance systems with the help of Aweray Awesun?

 

Smart Transportation

 

Soft and hard integrated solution to build intranet operation and maintenance, Aweray Awesun privatization deployment empowers Zhejiang Zhongche.

 

Intelligent Manufacturing

 

How to build an efficient cross-border remote technical support system when the manufacturing industry is out to sea?

 

Solution

 

IT Operation and Maintenance

 

Support ZTE's new fulcrum server operating system to Aweray the localization of Awesun empowerment.

 

How can enterprises quickly build a remote IT operation and maintenance system to deal with holiday business?

 

How does the first-line commercial equipment operate efficiently? Starting from these four aspects

 

Tips for remote IT management: How to group a large number of IT equipment? How to set up fast grouping?

 

To deal with the four major problems of chain operation and maintenance, Aweray Awesun IT operation and maintenance solutions to empower the chain retail industry.

 

Telecommuting

 

Deal with these three pain points, 'painless' to build enterprise telecommuting system

 

The Dragon Boat Festival holiday business is not interrupted, and the enterprise telecommuting plan is deployed in three steps.

 

After the telecommuting system is set up, how to manage IT assets in an enterprise in a unified way?

 

Technical Support

 

No longer piecemeal, how do enterprises build platform-based technical support services?

 

Efficient assistance, professional image, customer-oriented! Three aspects to build enterprise technical support professional reputation

 

How to ensure the security of remote control business? Analysis of the "whole process safety closed loop" system of Aweray Awesun

 

Search for this product

Search all.

Home Page AweSun Remote Computer Connecting PowerShell to a Remote Computer: A Comprehensive Guide

Connecting PowerShell to a Remote Computer: A Comprehensive Guide

Update Date:2026-01-07 10:42:08

PowerShell is a powerful scripting and automation tool that has revolutionized the way system administrators manage and automate tasks in Windows environments. One of its most valuable features is the ability to connect to and manage remote computers. This capability allows administrators to perform tasks on multiple machines from a single console, streamlining operations and improving efficiency. In this comprehensive guide, we will explore the steps and best practices for connecting PowerShell to a remote computer. We will cover the necessary prerequisites, the methods of connecting, and some advanced techniques for managing remote systems. By the end of this guide, you will have a solid understanding of how to leverage PowerShell for remote management, whether you are a seasoned administrator or a newcomer to the tool.

Prerequisites for Remote Management

Before you can connect PowerShell to a remote computer, there are several prerequisites that need to be in place. These prerequisites ensure that the connection is secure and that the remote computer is configured to accept and process remote commands.

PowerShell Version and Windows Update

Ensure that both your local and remote computers are running a compatible version of PowerShell. PowerShell 3.0 and later versions support remote management more robustly. Additionally, make sure that your Windows operating systems are up to date. This includes installing the latest service packs and security updates.

Windows Firewall Configuration

The Windows Firewall is a critical component in securing your system. By default, it blocks incoming connections, including those from PowerShell. To enable remote management, you need to configure the firewall to allow the necessary traffic. You can do this by creating or enabling specific firewall rules.

# Enable the WinRM service
Enable-PSRemoting -Force
# Allow WinRM traffic through the firewall
Set-NetFirewallRule -Name "FPS-ICMP4-ERQ-In" -Enabled True
Set-NetFirewallRule -Name "FPS-ICMP6-ERQ-In" -Enabled True
Set-NetFirewallRule -Name "FPS-ICMP4-ERQ-Out" -Enabled True
Set-NetFirewallRule -Name "FPS-ICMP6-ERQ-Out" -Enabled True

These commands will enable the necessary rules for PowerShell Remoting.

WinRM Service Configuration

The Windows Remote Management (WinRM) service is the backbone of PowerShell Remoting. It needs to be running and properly configured on both the local and remote computers.

# Start and set the WinRM service to automatic
Set-Service -Name "WinRM" -StartupType Automatic
Start-Service -Name "WinRM"

You can also configure WinRM to listen on specific ports and protocols:

# Configure WinRM to listen on HTTP
winrm quickconfig

This command will configure WinRM to listen on the default HTTP port (5985). If you need to use HTTPS for secure connections, you can configure it as follows:

# Create a self-signed certificate for HTTPS
$cert = New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "Cert:\LocalMachine\My"
# Configure WinRM to use HTTPS
winrm create winrm/config/Listener?Address=+Transport=HTTPS "@{Hostname=`"localhost`";CertificateThumbprint=`"$($cert.Thumbprint)`"}"

User Account and Permissions

The user account you use to connect to the remote computer must have the necessary permissions. The account should be a member of the local administrators group on the remote computer. You can also use a domain account if the computers are part of the same domain.

# Add a user to the administrators group
Add-LocalGroupMember -Group "Administrators" -Member "username"

Network Configuration

Ensure that the network configuration allows for communication between the local and remote computers. This includes proper network connectivity and the absence of network devices (such as routers or firewalls) that might block the necessary traffic.

Methods for Connecting to a Remote Computer

Once the prerequisites are in place, you can connect to a remote computer using several methods. Each method has its own advantages and use cases.

Using the Enter-PSSession Command

The Enter-PSSession cmdlet allows you to open an interactive session with a remote computer. This is useful for performing tasks that require immediate feedback.

# Connect to a remote computer
Enter-PSSession -ComputerName "RemoteComputerName" -Credential (Get-Credential)

This command opens a session to the specified remote computer. You will be prompted to enter the credentials for the remote session. Once connected, you can run PowerShell commands directly on the remote computer.

Using the Invoke-Command Cmdlet

The Invoke-Command cmdlet is used to run commands on one or more remote computers. This is particularly useful for automating tasks and running scripts on multiple machines.

# Run a command on a remote computer
Invoke-Command -ComputerName "RemoteComputerName" -Credential (Get-Credential) -ScriptBlock { Get-Process }
# Run a command on multiple remote computers
$computers = @("RemoteComputer1", "RemoteComputer2", "RemoteComputer3")
Invoke-Command -ComputerName $computers -Credential (Get-Credential) -ScriptBlock { Get-Process }

Using New-PSSession for Multi-Session Management

The New-PSSession cmdlet allows you to create multiple sessions to the same or different remote computers. This is useful for managing multiple tasks simultaneously.

# Create a session to a remote computer
$session = New-PSSession -ComputerName "RemoteComputerName" -Credential (Get-Credential)
# Run commands in the session
Invoke-Command -Session $session -ScriptBlock { Get-Process }
# Remove the session when done
Remove-PSSession -Session $session

Using New-CimSession for CIM-Based Management

The New-CimSession cmdlet is used to create a Common Information Model (CIM) session, which is another way to manage remote computers. CIM sessions are useful for managing systems that support the Common Information Model.

# Create a CIM session to a remote computer
$cimSession = New-CimSession -ComputerName "RemoteComputerName" -Credential (Get-Credential)
# Run a CIM query
Get-CimInstance -ClassName Win32_Process -CimSession $cimSession
# Remove the CIM session when done
Remove-CimSession -CimSession $cimSession

Advanced Techniques for Remote Management

Once you have a basic understanding of how to connect to a remote computer, you can explore some advanced techniques to further enhance your remote management capabilities.

Using Sessions for Scripting

You can use PowerShell sessions to run scripts on remote computers. This is useful for automating complex tasks or running scripts that require access to multiple remote systems.

# Create a session to a remote computer
$session = New-PSSession -ComputerName "RemoteComputerName" -Credential (Get-Credential)
# Copy a script to the remote computer
Copy-Item -Path "C:\Scripts\MyScript.ps1" -Destination "C:\Scripts\" -ToSession $session
# Run the script on the remote computer
Invoke-Command -Session $session -ScriptBlock { C:\Scripts\MyScript.ps1 }
# Remove the session when done
Remove-PSSession -Session $session

Using Background Jobs

Background jobs allow you to run commands or scripts on remote computers in the background. This is useful for tasks that take a long time to complete.

# Start a background job on a remote computer
$job = Start-Job -ScriptBlock { Invoke-Command -ComputerName "RemoteComputerName" -Credential (Get-Credential) -ScriptBlock { Get-Process } }
# Check the status of the job
Get-Job -Id $job.Id
# Retrieve the job results
Receive-Job -Job $job
# Remove the job when done
Remove-Job -Job $job

Using Credentials Securely

When working with remote computers, it is important to handle credentials securely. You can use the Get-Credential cmdlet to prompt for credentials, or you can store credentials securely using the Get-StoredCredential cmdlet from the CredentialManager module.

# Install the CredentialManager module
Install-Module -Name CredentialManager
# Store a credential securely
Set-StoredCredential -Target "RemoteComputerName" -Credential (Get-Credential)
# Retrieve the stored credential
$credential = Get-StoredCredential -Target "RemoteComputerName"
# Use the stored credential to connect to the remote computer
Invoke-Command -ComputerName "RemoteComputerName" -Credential $credential -ScriptBlock { Get-Process }

Using Group Policy for Configuration

If you are managing multiple computers in a domain, you can use Group Policy to configure PowerShell Remoting. This ensures that all managed computers are configured consistently.

  1. Open the Group Policy Management Console (GPMC).

  2. Create a new Group Policy Object (GPO) or edit an existing one.

  3. Navigate to Computer Configuration -> Policies -> Administrative Templates -> Windows Components -> Windows Remote Management (WinRM).

  4. Configure the necessary settings, such as enabling the WinRM service and configuring the listener.

  5. Link the GPO to the appropriate Organizational Unit (OU).

Using PowerShell for Large-Scale Management

For large-scale management, you can use PowerShell to manage hundreds or even thousands of computers. This involves scripting and automation to handle the scale of operations.

# List of remote computers
$computers = Get-Content -Path "C:\Computers.txt"
# Define the script block to run
$scriptBlock = {
$os = Get-CimInstance -ClassName Win32_OperatingSystem
$disk = Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DeviceID='C:'"
[PSCustomObject]@{
ComputerName = $env:COMPUTERNAME
OSVersion = $os.Version
FreeSpaceGB = [math]::round($disk.FreeSpace / 1GB, 2)
}
}
# Run the script block on all computers
(results = Invoke-Command -ComputerName $computers -Credential (Get-Credential) -ScriptBlock $scriptBlock)
# Output the results to a CSV file
$results | Export-Csv -Path "C:\Results.csv" -NoTypeInformation

Conclusion

PowerShell is a powerful tool for managing and automating tasks in Windows environments. Its ability to connect to and manage remote computers is a key feature that can significantly enhance your efficiency and effectiveness as a system administrator. By following the steps and best practices outlined in this guide, you can securely and effectively connect to remote computers and perform a wide range of tasks. Whether you are a seasoned administrator or a newcomer to PowerShell, mastering remote management with PowerShell will be a valuable skill in your toolkit.

FAQ

Q: What are the minimum PowerShell and Windows versions required for remote management? A: To ensure robust remote management capabilities, both your local and remote computers should be running PowerShell 3.0 or later. Additionally, your Windows operating systems should be up to date with the latest service packs and security updates. This ensures compatibility and security.

Q: How do I configure the Windows Firewall to allow PowerShell Remoting? A: To enable PowerShell Remoting through the Windows Firewall, you need to create or enable specific firewall rules. You can use the following PowerShell commands to enable the necessary rules:

Enable-PSRemoting -Force
Set-NetFirewallRule -Name "FPS-ICMP4-ERQ-In" -Enabled True
Set-NetFirewallRule -Name "FPS-ICMP6-ERQ-In" -Enabled True
Set-NetFirewallRule -Name "FPS-ICMP4-ERQ-Out" -Enabled True
Set-NetFirewallRule -Name "FPS-ICMP6-ERQ-Out" -Enabled True

These commands will allow the necessary traffic for PowerShell Remoting.

Q: What is the role of the WinRM service in PowerShell Remoting? A: The Windows Remote Management (WinRM) service is the backbone of PowerShell Remoting. It needs to be running and properly configured on both the local and remote computers. You can start and set the WinRM service to automatic using the following commands:

Set-Service -Name "WinRM" -StartupType Automatic
Start-Service -Name "WinRM"

Additionally, you can configure WinRM to listen on specific ports and protocols using the winrm quickconfig command for HTTP or the winrm create command for HTTPS.

Q: How can I securely handle credentials when connecting to remote computers? A: When working with remote computers, it is important to handle credentials securely. You can use the Get-Credential cmdlet to prompt for credentials, or you can store credentials securely using the Get-StoredCredential cmdlet from the CredentialManager module. Here is an example of storing and retrieving credentials:

# Install the CredentialManager module
Install-Module -Name CredentialManager
# Store a credential securely
Set-StoredCredential -Target "RemoteComputerName" -Credential (Get-Credential)
# Retrieve the stored credential
$credential = Get-StoredCredential -Target "RemoteComputerName"
# Use the stored credential to connect to the remote computer
Invoke-Command -ComputerName "RemoteComputerName" -Credential $credential -ScriptBlock { Get-Process }

This ensures that your credentials are stored and used securely.

Previous article:

Connecting to Y...

Next:

The Power of Re...

Did the content of the document help you?

Yes
No

If you encounter product-related problems, you can consult Online customer service Ask for help.

Document Feedback

Mouse selected content, quick feedback problem

If you have doubts in the selected document, you can quickly feedback the problem and we will follow up.

Example:

Dandelion Router

In the router management interface,In the router management interface,

①DHCP:ON;

② IP address range: fill in the start and end address segments;

Document Feedback  Document Feedback

Okay, I got it

Related issues

· Best Software for Remote Access to Computer: A Comprehensive Guide· Simplifying Remote Work with AweSun· The Power of Remote Desktop Computing· The Evolution of Computer Remote Control· Free Remote Login: Simplifying Access from Anywhere· Remotely Controlling Another Computer: A Comprehensive Guide

Other issues

· Exploring the Future of Remote Work with Windows 11 Remote Desktop· Exploring Remote Desktop Connection: A Seamless Solution for Remote Work· How to Fix Windows 10 Remote Desktop Authentic· How to operate unattended commercial equipment efficiently? Grasp three points and get it done easily· Simplifying Windows Remote Desktop and CMD Operations with AweSun· Exploring the World of Remote Desktop with Windows 10
Document Feedback

Introduction to this article

Prerequisites for Remote Management

Windows Firewall Configuration

These commands will enable the necessary rules for PowerShell Remoting.

Methods for Connecting to a Remote Computer

Using the Invoke-Command Cmdlet

Using New-PSSession for Multi-Session Management

Using New-CimSession for CIM-Based Management

Advanced Techniques for Remote Management

Using Background Jobs

Using Credentials Securely

Using Group Policy for Configuration

Using PowerShell for Large-Scale Management

Conclusion

FAQ

Purchase
  • AweSun
  • AweSeed
  • AweShell
  • Smart Hardware
Downloads
  • AweSun Client
  • AweSeed Client
  • AweShell Client
About
  • Company Profile
  • Partners
  • Blog
Support
  • Resources
  • Contact Us
  • Privacy Policy
  • Terms of Use
  • Cookies Policy
  • China Mainland site
Copyright ©2026 AweRay PTE All Rights Reserved.
Purchase
  • AweSun
  • AweSeed
  • AweShell
  • Smart Hardware
Downloads
  • AweSun Client
  • AweSeed Client
  • AweShell Client
About
  • Company Profile
  • Partners
  • Blog
Support
  • Resources
  • Contact Us
  • Privacy Policy
  • Terms of Use
  • Cookies Policy
  • China Mainland site
China Mainland site
Copyright ©2026 AweRay PTE All Rights Reserved.