Powershell remote, Enter-PSSession


user1010

Member
Local time
9:43 AM
Posts
30
OS
Windows 11
Tried to activate and configure wsman on another machine on my home network but can't connect. winrm quickconfig and added as firewall exception.

This is activated: Enable-PSRemoting -SkipNetworkProfileCheck -Force

PS C:\> Enter-PSSession -ComputerName computer1 -UseSSL -Credential user
Enter-PSSession : Connecting to remote server computer1 failed with the following error message : WinRM cannot complete
the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and
that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM
firewall exception for public profiles limits access to remote computers within the same local subnet. For more
information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ Enter-PSSession -ComputerName computer1 -UseSSL -Credential charlie
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (computer1:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
Both computers must be:
1. Operating on private network profile.
2. Have NETBIOS enabled for name resolution


Other than this you're using -UseSSL switch but you likely didn't configure SSL, did you?

Also your -Credential switch is incorrectly used.

A credential object consists of PC username and password that belong to Administrators group on remote computer.
The Administrator must have password set on remote computer, it can't be blank or unset because WinRM doesn't support password less authentication.

Resolve previous 2 points above then run:
Powershell:
Enable-PSRemoting

# This will ask for both, username and password
$Cred = Get-Credential
Enter-PSSession -ComputerName computer1 -Credential $Cred
 

My Computer

System One

  • OS
    Windows 11 Pro 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI / MS-7B29
    CPU
    Intel i3 8100 @3.6Ghz
    Motherboard
    H310M PRO-VDH (MS-7B29)
    Memory
    1 x 16GB DDR4 @2400 MHz
    Graphics Card(s)
    Nvidia GeForce GT 1030 2GB SDDR4
    Sound Card
    Realtek VEN_10EC&DEV_0887 / NVIDIA VEN_10DE&DEV_0081
    Monitor(s) Displays
    Acer V226HQL
    Screen Resolution
    1920 x 1080
    Hard Drives
    SSD 500 GB Crucial MX500 / HDD 1 TB TOSHIBA DT01ACA100
    PSU
    ATX, details unknown
    Case
    Everest 551B
    Cooling
    details unknown
    Keyboard
    Mechanical Gaming Hydra R7 - Rampage
    Mouse
    Logitech G703
    Internet Speed
    Down: 28Mbps / Up: 19Mbps
    Browser
    Microsoft Edge
    Antivirus
    Microsoft Defender Antivirus
    Other Info
    Bluetooth: TP Link 5.0 Nano USB adapter UB500
    WLAN: D-Link 150 Pico USB adapter, N standard
    Web camera: Logitech C270 HD 720p @30fps
    Microphone: Trust MICO, model 23790
Both computers must be:
1. Operating on private network profile.
2. Have NETBIOS enabled for name resolution


Other than this you're using -UseSSL switch but you likely didn't configure SSL, did you?

Also your -Credential switch is incorrectly used.

A credential object consists of PC username and password that belong to Administrators group on remote computer.
The Administrator must have password set on remote computer, it can't be blank or unset because WinRM doesn't support password less authentication.

Resolve previous 2 points above then run:
Powershell:
Enable-PSRemoting

# This will ask for both, username and password
$Cred = Get-Credential
Enter-PSSession -ComputerName computer1 -Credential $Cred
Only "winrm set winrm/config/service '@{AllowUnencrypted="true"}'" on the target machine. Both on private network. Netbios enable for name resolution didn't I find info about. Thank you.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
Netbios enable for name resolution didn't I find info about.
To enable NetBIOS click start button and type services.msc and run services app as Administrator.
Find service name TCP\IP NetBIOS Helper service and start it, also set it to Automatic startup on both computers.

Next on both computers restart service named Function Discovery Resource Publication

Enable-PSRemoting must be run in same edition of PowerShell in which you'll run your remote commands,
it should be run on remote computer, the one to which you'll connect from this computer.
ex. if you're using Windows PowerShell then don't use PowerShell Core but do all in Windows PS on both computers.

When you run Enable-PSRemoting on other computer run on this computer:

$Cred = Get-Credential Enter-PSSession -ComputerName computer1 -Credential $Cred

What's the error you're getting after performing all the steps?
 

My Computer

System One

  • OS
    Windows 11 Pro 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI / MS-7B29
    CPU
    Intel i3 8100 @3.6Ghz
    Motherboard
    H310M PRO-VDH (MS-7B29)
    Memory
    1 x 16GB DDR4 @2400 MHz
    Graphics Card(s)
    Nvidia GeForce GT 1030 2GB SDDR4
    Sound Card
    Realtek VEN_10EC&DEV_0887 / NVIDIA VEN_10DE&DEV_0081
    Monitor(s) Displays
    Acer V226HQL
    Screen Resolution
    1920 x 1080
    Hard Drives
    SSD 500 GB Crucial MX500 / HDD 1 TB TOSHIBA DT01ACA100
    PSU
    ATX, details unknown
    Case
    Everest 551B
    Cooling
    details unknown
    Keyboard
    Mechanical Gaming Hydra R7 - Rampage
    Mouse
    Logitech G703
    Internet Speed
    Down: 28Mbps / Up: 19Mbps
    Browser
    Microsoft Edge
    Antivirus
    Microsoft Defender Antivirus
    Other Info
    Bluetooth: TP Link 5.0 Nano USB adapter UB500
    WLAN: D-Link 150 Pico USB adapter, N standard
    Web camera: Logitech C270 HD 720p @30fps
    Microphone: Trust MICO, model 23790
To enable NetBIOS click start button and type services.msc and run services app as Administrator.
Find service name TCP\IP NetBIOS Helper service and start it, also set it to Automatic startup on both computers.

Next on both computers restart service named Function Discovery Resource Publication

Enable-PSRemoting
must be run in same edition of PowerShell in which you'll run your remote commands,
it should be run on remote computer, the one to which you'll connect from this computer.
ex. if you're using Windows PowerShell then don't use PowerShell Core but do all in Windows PS on both computers.

When you run Enable-PSRemoting on other computer run on this computer:

$Cred = Get-Credential Enter-PSSession -ComputerName computer1 -Credential $Cred

What's the error you're getting after performing all the steps?

It works now :)

"PSVersion 5.1.22621.2506" on both computers.

Netbios Helper was started on both but changed the service to automatic. Restarted "Function Discovery..". I try with ip instead of hostname because it seems to go to ipv6 else.

Added trusted hosts on both computers with Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value IP-Address.

Earlier error message:

PS C:\WINDOWS\system32> enter-pssession -computername ip-address -credential user
enter-pssession : Connecting to remote server ip-address failed with the following error message : The WinRM client
cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not
joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts
configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not
be authenticated. You can get more information about that by running the following command: winrm help config. For
more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ enter-pssession -computername IP -credential user
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (ip-address:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus
Good job!
Remoting can be difficult to setup and diagnose because there is a lot of variables that need to be taken care of and WinRM error messages are often not self explanatory.
 

My Computer

System One

  • OS
    Windows 11 Pro 23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    MSI / MS-7B29
    CPU
    Intel i3 8100 @3.6Ghz
    Motherboard
    H310M PRO-VDH (MS-7B29)
    Memory
    1 x 16GB DDR4 @2400 MHz
    Graphics Card(s)
    Nvidia GeForce GT 1030 2GB SDDR4
    Sound Card
    Realtek VEN_10EC&DEV_0887 / NVIDIA VEN_10DE&DEV_0081
    Monitor(s) Displays
    Acer V226HQL
    Screen Resolution
    1920 x 1080
    Hard Drives
    SSD 500 GB Crucial MX500 / HDD 1 TB TOSHIBA DT01ACA100
    PSU
    ATX, details unknown
    Case
    Everest 551B
    Cooling
    details unknown
    Keyboard
    Mechanical Gaming Hydra R7 - Rampage
    Mouse
    Logitech G703
    Internet Speed
    Down: 28Mbps / Up: 19Mbps
    Browser
    Microsoft Edge
    Antivirus
    Microsoft Defender Antivirus
    Other Info
    Bluetooth: TP Link 5.0 Nano USB adapter UB500
    WLAN: D-Link 150 Pico USB adapter, N standard
    Web camera: Logitech C270 HD 720p @30fps
    Microphone: Trust MICO, model 23790

Latest Support Threads

Back
Top Bottom