PowerShell tips for adding remote firewall rules _powershell

Source: Internet
Author: User

Then yesterday's scene, although the default console for Windows Server Core is set to PowerShell, Remote Desktop is enabled, but for the core version of the server, Remote Desktop is the same as chicken, so I want to enable PowerShell remote access, Run with administrator rights on the server:

Enable-psremoting-force

When attempting to establish a remote connection, prompt access is denied, which may be a firewall problem: I need to add PowerShell remote firewall rules using PowerShell:

New-netfirewallrule-name powershell-remote-tcp-direction inbound-displayname ' PowerShell remote connection tcp '-localport 5985-5996-protocol ' TCP '
new-netfirewallrule-name powershell-remote-udp-direction inbound-displayname ' PowerShell remote connection UDP '-localport 5985-5996-protocol ' UDP '

Try to establish the connection again:

ps> enter-pssession-computername 192.168.1.15-credential Administrator
[192.168.1.15]: PS C:\Users\ administrator\documents> hostname
AD-2012

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.