{"id":88,"date":"2021-07-19T16:34:00","date_gmt":"2021-07-19T06:34:00","guid":{"rendered":"https:\/\/wp.eejin.org\/?p=88"},"modified":"2021-07-19T17:26:26","modified_gmt":"2021-07-19T07:26:26","slug":"enabling-powershell-remoting-fails-due-to-public-network-connection-type","status":"publish","type":"post","link":"https:\/\/wp.eejin.org\/?p=88","title":{"rendered":"Enabling PowerShell remoting fails due to Public network connection type"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>If the network connection type is set to\u00a0<\/strong><em>Public<\/em><strong>,\u00a0<\/strong><a href=\"https:\/\/4sysops.com\/archives\/enable-powershell-remoting\/\">enabling PowerShell remoting<\/a><strong>\u00a0might fail because by default, PowerShell expects domain or private connection types.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you try to enable PowerShell remoting on a PowerShell console with&nbsp;<em>Enable-PSRemoting \u2011Force<\/em>, you will sometimes receive the error message below:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WinRM firewall exception will not work<a href=\"https:\/\/4sysops.com\/archives\/enabling-powershell-remoting-fails-due-to-public-network-connection-type\/#Content-bal-title\">&nbsp;^<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Set-WSManQuickConfig : &#8230;&nbsp;WinRM firewall exception will not work since one of the network connection types&nbsp;on this machine is set to Public. Change the network connection type to either Domain or Private and try again. &#8230;<br><\/em>The reason is that the computer will allow connections with other devices in the same network if the network connection type is&nbsp;<em>Public.<\/em>&nbsp;Microsoft considers it as a security risk if you enable PowerShell remoting in a&nbsp;<em>Public<\/em>&nbsp;network.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can verify your current connection type settings in the Control Panel:&nbsp;<strong>Control Panel\\Network and Internet\\Network and Sharing Center<\/strong><a href=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Viewing-networking-connection-type-in-the-Control-Panel.png\"><\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Viewing-networking-connection-type-in-the-Control-Panel.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"caption-attachment-254856\">Viewing networking connection type in the Control Panel<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also check your profile settings with the PowerShell cmdlet&nbsp;<em>Get-NetConnectionProfile<\/em>. The&nbsp;<em>NetworkCategory<\/em>&nbsp;property corresponds to the network connection type.<a href=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Displaying-the-network-connection-type-with-PowerShell.png\"><\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Displaying-the-network-connection-type-with-PowerShell.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"caption-attachment-254852\">Displaying the network connection type with PowerShell<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This problem can even occur if your computer is an Active Directory member. If you&#8217;ve previously signed on to the member machine, Windows will cache your credentials, and you can log on without an available domain controller. In that case, Windows will automatically set your connection type to&nbsp;<em>Public<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If a domain controller has authenticated you, it will set the network category to&nbsp;<em>DomainAuthenticated<\/em>:<a href=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/NetworkCategory-is-set-to-DomainAuthenicated.png\"><\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/NetworkCategory-is-set-to-DomainAuthenicated.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"caption-attachment-254853\">NetworkCategory is set to DomainAuthenicated<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Skipping the network profile check<a href=\"https:\/\/4sysops.com\/archives\/enabling-powershell-remoting-fails-due-to-public-network-connection-type\/#Content-bal-title\">&nbsp;^<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this case, PowerShell won&#8217;t throw an error if you enable remoting. However, if a domain controller hasn&#8217;t authenticated your computer, you have two options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the&nbsp;<em>SkipNetworkProfileCheck<\/em>&nbsp;parameter, you can just ignore the warning:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>Enable-PSRemoting -SkipNetworkProfileCheck -Force<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The&nbsp;<em>Force<\/em>&nbsp;parameter avoids the confirmation prompt.<a href=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Using-the-SkipNetworkProfileCheck-parameter.png\"><\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Using-the-SkipNetworkProfileCheck-parameter.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"caption-attachment-254861\">Using the SkipNetworkProfileCheck parameter<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Changing the network connection type with PowerShell<a href=\"https:\/\/4sysops.com\/archives\/enabling-powershell-remoting-fails-due-to-public-network-connection-type\/#Content-bal-title\">&nbsp;^<\/a><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">However, this option poses a security risk because Windows enables network discovery features for your computer. Thus, it is better to change the connection type manually to&nbsp;<em>Private<\/em>:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>1<\/td><td>Set-NetConnectionProfile -NetworkCategory Private<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Changing-the-network-connection-type-to-private.png\"><\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"caption-attachment-254854\">Changing the network connection type to private<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/4sysops.com\/wp-content\/uploads\/2017\/09\/Changing-the-network-connection-type-to-private.png\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Notice that you can&#8217;t set the&nbsp;<em>NetworkCategory<\/em>&nbsp;property to&nbsp;<em>DomainAuthenticated<\/em>. If you try, PowerShell will return an error:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>Set-NetConnectionProfile : Unable to set NetworkCategory to &#8216;DomainAuthenticated&#8217;. This NetworkCategory type will be set automatically when authenticated to a domain network.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Notice that&nbsp;<a href=\"https:\/\/4sysops.com\/archives\/enable-powershell-remoting-on-a-standalone-workgroup-computer\/\">if your computer is not a domain member<\/a>, you have to consider a few other things if you enable PowerShell remoting.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If the network connection type is set to\u00a0Public,\u00a0enabling PowerShell remoting\u00a0might fail because by default, PowerShell expects domain or private connection types. If you try to enable PowerShell remoting on a PowerShell console with&nbsp;Enable-PSRemoting \u2011Force, you will sometimes receive the error &hellip; <a href=\"https:\/\/wp.eejin.org\/?p=88\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wp.eejin.org\/index.php?rest_route=\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.eejin.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.eejin.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.eejin.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.eejin.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=88"}],"version-history":[{"count":1,"href":"https:\/\/wp.eejin.org\/index.php?rest_route=\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":89,"href":"https:\/\/wp.eejin.org\/index.php?rest_route=\/wp\/v2\/posts\/88\/revisions\/89"}],"wp:attachment":[{"href":"https:\/\/wp.eejin.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.eejin.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.eejin.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}