Enable file and print sharing command line - how to enable it just for profile=privateHow do I configure Windows Firewall to permit MSRPC?How to configure Windows Firewall to protect the external interface but not the internal one?Slow SMB/CIFS to/from Win2008R2 ServerWhy is file sharing over internet still working, despite all firewall exceptions for filesharing being disabled?Disable “Windows Firewall with Advanced Security” for all profiles(Domain,Public,Standard) in local GP using script help! Windows 7 Clientscan I reset the windows 7 public firewall profile defaults?Windows 2K8 R2 in AD environment not allowing SMB connectionslan to wan connection refused by windows firewallWindows network shares still visible (and accessible) with “file and printer sharing” deactivatedEnabling Network Discovery via GPO does not work when Windows Firewall turned on

Does an ice chest packed full of frozen food need ice?

Logarithm of exponential

Do simulator games use a realistic trajectory to get into orbit?

Why is one of Madera Municipal's runways labelled with only "R" on both sides?

What is the highest possible temporary AC at level 1, without any help from others?

How to deal with apathetic co-worker?

Difference between > and >> when used with a named pipe

1980s live-action movie where individually-coloured nations on clouds fight

Arriving at the same result with the opposite hypotheses

What do abbreviations in movie scripts stand for?

Soft question: Examples where lack of mathematical rigour cause security breaches?

Why did the Herschel Space Telescope need helium coolant?

Is the term 'open source' a trademark?

How did old MS-DOS games utilize various graphic cards?

Is it a problem if <h4>, <h5> and <h6> are smaller than regular text?

How to tell your grandparent to not come to fetch you with their car?

Second (easy access) account in case my bank screws up

This riddle is not to see but to solve

Generate a Graeco-Latin square

English word for "product of tinkering"

What can I, as a user, do about offensive reviews in App Store?

How can "научись" mean "take it and keep trying"?

Does Disney no longer produce hand-drawn cartoon films?

Overlapping String-Blocks



Enable file and print sharing command line - how to enable it just for profile=private


How do I configure Windows Firewall to permit MSRPC?How to configure Windows Firewall to protect the external interface but not the internal one?Slow SMB/CIFS to/from Win2008R2 ServerWhy is file sharing over internet still working, despite all firewall exceptions for filesharing being disabled?Disable “Windows Firewall with Advanced Security” for all profiles(Domain,Public,Standard) in local GP using script help! Windows 7 Clientscan I reset the windows 7 public firewall profile defaults?Windows 2K8 R2 in AD environment not allowing SMB connectionslan to wan connection refused by windows firewallWindows network shares still visible (and accessible) with “file and printer sharing” deactivatedEnabling Network Discovery via GPO does not work when Windows Firewall turned on






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








3















I know that the following cmd can enable file and print sharing firewall rule:



netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes


But it turns on file and print sharing for all profiles.



I'd like to only enable it for private profile, i.e. when the windows PC/laptops are connected to home or work network. I especially try to avoid turn it on for laptops connected to public network. Ideally Network discovery should be turned off for public network.



I've tried



netsh advfirewall firewall set rule group=”File and Printer Sharing” profile=private new enable=Yes


and 'profile' switch is rejected. So how can I apply the firewall rule selectively?



many thx for any input..










share|improve this question




























    3















    I know that the following cmd can enable file and print sharing firewall rule:



    netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes


    But it turns on file and print sharing for all profiles.



    I'd like to only enable it for private profile, i.e. when the windows PC/laptops are connected to home or work network. I especially try to avoid turn it on for laptops connected to public network. Ideally Network discovery should be turned off for public network.



    I've tried



    netsh advfirewall firewall set rule group=”File and Printer Sharing” profile=private new enable=Yes


    and 'profile' switch is rejected. So how can I apply the firewall rule selectively?



    many thx for any input..










    share|improve this question
























      3












      3








      3


      1






      I know that the following cmd can enable file and print sharing firewall rule:



      netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes


      But it turns on file and print sharing for all profiles.



      I'd like to only enable it for private profile, i.e. when the windows PC/laptops are connected to home or work network. I especially try to avoid turn it on for laptops connected to public network. Ideally Network discovery should be turned off for public network.



      I've tried



      netsh advfirewall firewall set rule group=”File and Printer Sharing” profile=private new enable=Yes


      and 'profile' switch is rejected. So how can I apply the firewall rule selectively?



      many thx for any input..










      share|improve this question














      I know that the following cmd can enable file and print sharing firewall rule:



      netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes


      But it turns on file and print sharing for all profiles.



      I'd like to only enable it for private profile, i.e. when the windows PC/laptops are connected to home or work network. I especially try to avoid turn it on for laptops connected to public network. Ideally Network discovery should be turned off for public network.



      I've tried



      netsh advfirewall firewall set rule group=”File and Printer Sharing” profile=private new enable=Yes


      and 'profile' switch is rejected. So how can I apply the firewall rule selectively?



      many thx for any input..







      windows-firewall






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 19 '13 at 11:35









      user1866880user1866880

      2595818




      2595818




















          5 Answers
          5






          active

          oldest

          votes


















          2














          You are activating a preset rule, and I am guessing that the preset rule has Profile=any in it.



          Try this first:



          netsh advfirewall firewall set rule group="File and Printer Sharing" new profile=private





          share|improve this answer

























          • Tried it, failed. Error: Only the enable parameter can be used to update rules specified by a group.. But thx for the reply.

            – user1866880
            Jun 19 '13 at 20:31












          • oops I guess you can't edit the groups, or even show them with netsh. File and Printer sharing group contains these rules:

            – Rod MacPherson
            Jun 19 '13 at 20:53











          • File and Printer Sharing (Echo Request - ICMPv4-In) File and Printer Sharing (Echo Request - ICMPv4-Out) File and Printer Sharing (Echo Request - ICMPv6-In) File and Printer Sharing (Echo Request - ICMPv6-Out) File and Printer Sharing (LLMNR-UDP-In) File and Printer Sharing (LLMNR-UDP-Out) File and Printer Sharing (NB-Datagram-In) File and Printer Sharing (NB-Datagram-Out)

            – Rod MacPherson
            Jun 19 '13 at 20:53











          • File and Printer Sharing (NB-Name-In) File and Printer Sharing (NB-Name-Out) File and Printer Sharing (NB-Session-In) File and Printer Sharing (NB-Session-Out) File and Printer Sharing (SMB-In) File and Printer Sharing (SMB-Out) File and Printer Sharing (Spooler Service - RPC-EPMAP) File and Printer Sharing (Spooler Service - RPC)

            – Rod MacPherson
            Jun 19 '13 at 20:54


















          4














          netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=public|private|domain new enable=Yes|No


          To set three profiles together at one time, use:



          netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in new enable=Yes


          The rule name must be changed in your local language, for example:



          netsh advfirewall firewall set rule name="檔案及印表機共用 (SMB-In)" dir=in profile=private new enable=Yes


          Don't forget to run as an administrator.






          share|improve this answer
































            0














            Circling around the subject there are rare cases when using local language names doesn't work, ie. Polish Udostępnianie plików i drukarek (SMB — ruch przychodzący) = File and Printer Sharing (SMB-In). I believe this has something to do with UTF-8 handling in netsh as there are reports that using netsh for connecting to UTF-named wifi networks sometimes doesn't work too.



            In those cases use PowerShell's Set-NetFirewallRule and language-agnostic "Name" parameter (in this very case FPS-SMB-In-TCP). Use Get-NetFirewallRule command to get all the correct names for your rules.






            share|improve this answer
































              0














              Type this in an elevated powershell prompt :



              Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private


              It worked for me on Windows 10 1703






              share|improve this answer























              • what about if the entire group "File And Printer Sharing" does not exist inbound?

                – Hicsy
                Apr 15 at 3:04


















              0














              Building on @Mulder's answer, to enable it for private mode, it needs to be set specifically for each rule in "Windows Defender Firewall with Advanced Security".




              To run Windows Defender Firewall with Advanced Security


              Run the following in an Administrative Powershell window ... to review possible rules:

              "C:WINDOWSsystem32mmc.exe" "C:WINDOWSsystem32wf.msc" 



              To allow access for File/Print only on private network



              Run the following in an Administrative Powershell window.



              # Allow access to administrative shares through firewall [Ref: https://serverfault.com/a/739272]
              netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv4-In)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv6-In)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (LLMNR-UDP-In)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Datagram-In)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Name-In)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Session-In)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC)" dir=in profile=private new enable=Yes
              netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC-EPMAP)" dir=in profile=private new enable=Yes





              share|improve this answer























                Your Answer








                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "2"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader:
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                ,
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f516920%2fenable-file-and-print-sharing-command-line-how-to-enable-it-just-for-profile-p%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                2














                You are activating a preset rule, and I am guessing that the preset rule has Profile=any in it.



                Try this first:



                netsh advfirewall firewall set rule group="File and Printer Sharing" new profile=private





                share|improve this answer

























                • Tried it, failed. Error: Only the enable parameter can be used to update rules specified by a group.. But thx for the reply.

                  – user1866880
                  Jun 19 '13 at 20:31












                • oops I guess you can't edit the groups, or even show them with netsh. File and Printer sharing group contains these rules:

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (Echo Request - ICMPv4-In) File and Printer Sharing (Echo Request - ICMPv4-Out) File and Printer Sharing (Echo Request - ICMPv6-In) File and Printer Sharing (Echo Request - ICMPv6-Out) File and Printer Sharing (LLMNR-UDP-In) File and Printer Sharing (LLMNR-UDP-Out) File and Printer Sharing (NB-Datagram-In) File and Printer Sharing (NB-Datagram-Out)

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (NB-Name-In) File and Printer Sharing (NB-Name-Out) File and Printer Sharing (NB-Session-In) File and Printer Sharing (NB-Session-Out) File and Printer Sharing (SMB-In) File and Printer Sharing (SMB-Out) File and Printer Sharing (Spooler Service - RPC-EPMAP) File and Printer Sharing (Spooler Service - RPC)

                  – Rod MacPherson
                  Jun 19 '13 at 20:54















                2














                You are activating a preset rule, and I am guessing that the preset rule has Profile=any in it.



                Try this first:



                netsh advfirewall firewall set rule group="File and Printer Sharing" new profile=private





                share|improve this answer

























                • Tried it, failed. Error: Only the enable parameter can be used to update rules specified by a group.. But thx for the reply.

                  – user1866880
                  Jun 19 '13 at 20:31












                • oops I guess you can't edit the groups, or even show them with netsh. File and Printer sharing group contains these rules:

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (Echo Request - ICMPv4-In) File and Printer Sharing (Echo Request - ICMPv4-Out) File and Printer Sharing (Echo Request - ICMPv6-In) File and Printer Sharing (Echo Request - ICMPv6-Out) File and Printer Sharing (LLMNR-UDP-In) File and Printer Sharing (LLMNR-UDP-Out) File and Printer Sharing (NB-Datagram-In) File and Printer Sharing (NB-Datagram-Out)

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (NB-Name-In) File and Printer Sharing (NB-Name-Out) File and Printer Sharing (NB-Session-In) File and Printer Sharing (NB-Session-Out) File and Printer Sharing (SMB-In) File and Printer Sharing (SMB-Out) File and Printer Sharing (Spooler Service - RPC-EPMAP) File and Printer Sharing (Spooler Service - RPC)

                  – Rod MacPherson
                  Jun 19 '13 at 20:54













                2












                2








                2







                You are activating a preset rule, and I am guessing that the preset rule has Profile=any in it.



                Try this first:



                netsh advfirewall firewall set rule group="File and Printer Sharing" new profile=private





                share|improve this answer















                You are activating a preset rule, and I am guessing that the preset rule has Profile=any in it.



                Try this first:



                netsh advfirewall firewall set rule group="File and Printer Sharing" new profile=private






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 11 '17 at 9:27









                Gerald Schneider

                7,14832748




                7,14832748










                answered Jun 19 '13 at 14:10









                Rod MacPhersonRod MacPherson

                20116




                20116












                • Tried it, failed. Error: Only the enable parameter can be used to update rules specified by a group.. But thx for the reply.

                  – user1866880
                  Jun 19 '13 at 20:31












                • oops I guess you can't edit the groups, or even show them with netsh. File and Printer sharing group contains these rules:

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (Echo Request - ICMPv4-In) File and Printer Sharing (Echo Request - ICMPv4-Out) File and Printer Sharing (Echo Request - ICMPv6-In) File and Printer Sharing (Echo Request - ICMPv6-Out) File and Printer Sharing (LLMNR-UDP-In) File and Printer Sharing (LLMNR-UDP-Out) File and Printer Sharing (NB-Datagram-In) File and Printer Sharing (NB-Datagram-Out)

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (NB-Name-In) File and Printer Sharing (NB-Name-Out) File and Printer Sharing (NB-Session-In) File and Printer Sharing (NB-Session-Out) File and Printer Sharing (SMB-In) File and Printer Sharing (SMB-Out) File and Printer Sharing (Spooler Service - RPC-EPMAP) File and Printer Sharing (Spooler Service - RPC)

                  – Rod MacPherson
                  Jun 19 '13 at 20:54

















                • Tried it, failed. Error: Only the enable parameter can be used to update rules specified by a group.. But thx for the reply.

                  – user1866880
                  Jun 19 '13 at 20:31












                • oops I guess you can't edit the groups, or even show them with netsh. File and Printer sharing group contains these rules:

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (Echo Request - ICMPv4-In) File and Printer Sharing (Echo Request - ICMPv4-Out) File and Printer Sharing (Echo Request - ICMPv6-In) File and Printer Sharing (Echo Request - ICMPv6-Out) File and Printer Sharing (LLMNR-UDP-In) File and Printer Sharing (LLMNR-UDP-Out) File and Printer Sharing (NB-Datagram-In) File and Printer Sharing (NB-Datagram-Out)

                  – Rod MacPherson
                  Jun 19 '13 at 20:53











                • File and Printer Sharing (NB-Name-In) File and Printer Sharing (NB-Name-Out) File and Printer Sharing (NB-Session-In) File and Printer Sharing (NB-Session-Out) File and Printer Sharing (SMB-In) File and Printer Sharing (SMB-Out) File and Printer Sharing (Spooler Service - RPC-EPMAP) File and Printer Sharing (Spooler Service - RPC)

                  – Rod MacPherson
                  Jun 19 '13 at 20:54
















                Tried it, failed. Error: Only the enable parameter can be used to update rules specified by a group.. But thx for the reply.

                – user1866880
                Jun 19 '13 at 20:31






                Tried it, failed. Error: Only the enable parameter can be used to update rules specified by a group.. But thx for the reply.

                – user1866880
                Jun 19 '13 at 20:31














                oops I guess you can't edit the groups, or even show them with netsh. File and Printer sharing group contains these rules:

                – Rod MacPherson
                Jun 19 '13 at 20:53





                oops I guess you can't edit the groups, or even show them with netsh. File and Printer sharing group contains these rules:

                – Rod MacPherson
                Jun 19 '13 at 20:53













                File and Printer Sharing (Echo Request - ICMPv4-In) File and Printer Sharing (Echo Request - ICMPv4-Out) File and Printer Sharing (Echo Request - ICMPv6-In) File and Printer Sharing (Echo Request - ICMPv6-Out) File and Printer Sharing (LLMNR-UDP-In) File and Printer Sharing (LLMNR-UDP-Out) File and Printer Sharing (NB-Datagram-In) File and Printer Sharing (NB-Datagram-Out)

                – Rod MacPherson
                Jun 19 '13 at 20:53





                File and Printer Sharing (Echo Request - ICMPv4-In) File and Printer Sharing (Echo Request - ICMPv4-Out) File and Printer Sharing (Echo Request - ICMPv6-In) File and Printer Sharing (Echo Request - ICMPv6-Out) File and Printer Sharing (LLMNR-UDP-In) File and Printer Sharing (LLMNR-UDP-Out) File and Printer Sharing (NB-Datagram-In) File and Printer Sharing (NB-Datagram-Out)

                – Rod MacPherson
                Jun 19 '13 at 20:53













                File and Printer Sharing (NB-Name-In) File and Printer Sharing (NB-Name-Out) File and Printer Sharing (NB-Session-In) File and Printer Sharing (NB-Session-Out) File and Printer Sharing (SMB-In) File and Printer Sharing (SMB-Out) File and Printer Sharing (Spooler Service - RPC-EPMAP) File and Printer Sharing (Spooler Service - RPC)

                – Rod MacPherson
                Jun 19 '13 at 20:54





                File and Printer Sharing (NB-Name-In) File and Printer Sharing (NB-Name-Out) File and Printer Sharing (NB-Session-In) File and Printer Sharing (NB-Session-Out) File and Printer Sharing (SMB-In) File and Printer Sharing (SMB-Out) File and Printer Sharing (Spooler Service - RPC-EPMAP) File and Printer Sharing (Spooler Service - RPC)

                – Rod MacPherson
                Jun 19 '13 at 20:54













                4














                netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=public|private|domain new enable=Yes|No


                To set three profiles together at one time, use:



                netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in new enable=Yes


                The rule name must be changed in your local language, for example:



                netsh advfirewall firewall set rule name="檔案及印表機共用 (SMB-In)" dir=in profile=private new enable=Yes


                Don't forget to run as an administrator.






                share|improve this answer





























                  4














                  netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=public|private|domain new enable=Yes|No


                  To set three profiles together at one time, use:



                  netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in new enable=Yes


                  The rule name must be changed in your local language, for example:



                  netsh advfirewall firewall set rule name="檔案及印表機共用 (SMB-In)" dir=in profile=private new enable=Yes


                  Don't forget to run as an administrator.






                  share|improve this answer



























                    4












                    4








                    4







                    netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=public|private|domain new enable=Yes|No


                    To set three profiles together at one time, use:



                    netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in new enable=Yes


                    The rule name must be changed in your local language, for example:



                    netsh advfirewall firewall set rule name="檔案及印表機共用 (SMB-In)" dir=in profile=private new enable=Yes


                    Don't forget to run as an administrator.






                    share|improve this answer















                    netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=public|private|domain new enable=Yes|No


                    To set three profiles together at one time, use:



                    netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in new enable=Yes


                    The rule name must be changed in your local language, for example:



                    netsh advfirewall firewall set rule name="檔案及印表機共用 (SMB-In)" dir=in profile=private new enable=Yes


                    Don't forget to run as an administrator.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Nov 27 '15 at 7:40









                    HBruijn

                    58.4k1191155




                    58.4k1191155










                    answered Nov 27 '15 at 7:14









                    MulderMulder

                    411




                    411





















                        0














                        Circling around the subject there are rare cases when using local language names doesn't work, ie. Polish Udostępnianie plików i drukarek (SMB — ruch przychodzący) = File and Printer Sharing (SMB-In). I believe this has something to do with UTF-8 handling in netsh as there are reports that using netsh for connecting to UTF-named wifi networks sometimes doesn't work too.



                        In those cases use PowerShell's Set-NetFirewallRule and language-agnostic "Name" parameter (in this very case FPS-SMB-In-TCP). Use Get-NetFirewallRule command to get all the correct names for your rules.






                        share|improve this answer





























                          0














                          Circling around the subject there are rare cases when using local language names doesn't work, ie. Polish Udostępnianie plików i drukarek (SMB — ruch przychodzący) = File and Printer Sharing (SMB-In). I believe this has something to do with UTF-8 handling in netsh as there are reports that using netsh for connecting to UTF-named wifi networks sometimes doesn't work too.



                          In those cases use PowerShell's Set-NetFirewallRule and language-agnostic "Name" parameter (in this very case FPS-SMB-In-TCP). Use Get-NetFirewallRule command to get all the correct names for your rules.






                          share|improve this answer



























                            0












                            0








                            0







                            Circling around the subject there are rare cases when using local language names doesn't work, ie. Polish Udostępnianie plików i drukarek (SMB — ruch przychodzący) = File and Printer Sharing (SMB-In). I believe this has something to do with UTF-8 handling in netsh as there are reports that using netsh for connecting to UTF-named wifi networks sometimes doesn't work too.



                            In those cases use PowerShell's Set-NetFirewallRule and language-agnostic "Name" parameter (in this very case FPS-SMB-In-TCP). Use Get-NetFirewallRule command to get all the correct names for your rules.






                            share|improve this answer















                            Circling around the subject there are rare cases when using local language names doesn't work, ie. Polish Udostępnianie plików i drukarek (SMB — ruch przychodzący) = File and Printer Sharing (SMB-In). I believe this has something to do with UTF-8 handling in netsh as there are reports that using netsh for connecting to UTF-named wifi networks sometimes doesn't work too.



                            In those cases use PowerShell's Set-NetFirewallRule and language-agnostic "Name" parameter (in this very case FPS-SMB-In-TCP). Use Get-NetFirewallRule command to get all the correct names for your rules.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited May 11 '17 at 9:28









                            Gerald Schneider

                            7,14832748




                            7,14832748










                            answered May 11 '17 at 9:27









                            MatiasMatias

                            1




                            1





















                                0














                                Type this in an elevated powershell prompt :



                                Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private


                                It worked for me on Windows 10 1703






                                share|improve this answer























                                • what about if the entire group "File And Printer Sharing" does not exist inbound?

                                  – Hicsy
                                  Apr 15 at 3:04















                                0














                                Type this in an elevated powershell prompt :



                                Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private


                                It worked for me on Windows 10 1703






                                share|improve this answer























                                • what about if the entire group "File And Printer Sharing" does not exist inbound?

                                  – Hicsy
                                  Apr 15 at 3:04













                                0












                                0








                                0







                                Type this in an elevated powershell prompt :



                                Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private


                                It worked for me on Windows 10 1703






                                share|improve this answer













                                Type this in an elevated powershell prompt :



                                Set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Private


                                It worked for me on Windows 10 1703







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Aug 30 '17 at 23:36









                                Anthony HocquetAnthony Hocquet

                                115




                                115












                                • what about if the entire group "File And Printer Sharing" does not exist inbound?

                                  – Hicsy
                                  Apr 15 at 3:04

















                                • what about if the entire group "File And Printer Sharing" does not exist inbound?

                                  – Hicsy
                                  Apr 15 at 3:04
















                                what about if the entire group "File And Printer Sharing" does not exist inbound?

                                – Hicsy
                                Apr 15 at 3:04





                                what about if the entire group "File And Printer Sharing" does not exist inbound?

                                – Hicsy
                                Apr 15 at 3:04











                                0














                                Building on @Mulder's answer, to enable it for private mode, it needs to be set specifically for each rule in "Windows Defender Firewall with Advanced Security".




                                To run Windows Defender Firewall with Advanced Security


                                Run the following in an Administrative Powershell window ... to review possible rules:

                                "C:WINDOWSsystem32mmc.exe" "C:WINDOWSsystem32wf.msc" 



                                To allow access for File/Print only on private network



                                Run the following in an Administrative Powershell window.



                                # Allow access to administrative shares through firewall [Ref: https://serverfault.com/a/739272]
                                netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv4-In)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv6-In)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (LLMNR-UDP-In)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Datagram-In)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Name-In)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Session-In)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC)" dir=in profile=private new enable=Yes
                                netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC-EPMAP)" dir=in profile=private new enable=Yes





                                share|improve this answer



























                                  0














                                  Building on @Mulder's answer, to enable it for private mode, it needs to be set specifically for each rule in "Windows Defender Firewall with Advanced Security".




                                  To run Windows Defender Firewall with Advanced Security


                                  Run the following in an Administrative Powershell window ... to review possible rules:

                                  "C:WINDOWSsystem32mmc.exe" "C:WINDOWSsystem32wf.msc" 



                                  To allow access for File/Print only on private network



                                  Run the following in an Administrative Powershell window.



                                  # Allow access to administrative shares through firewall [Ref: https://serverfault.com/a/739272]
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv4-In)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv6-In)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (LLMNR-UDP-In)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Datagram-In)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Name-In)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Session-In)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC)" dir=in profile=private new enable=Yes
                                  netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC-EPMAP)" dir=in profile=private new enable=Yes





                                  share|improve this answer

























                                    0












                                    0








                                    0







                                    Building on @Mulder's answer, to enable it for private mode, it needs to be set specifically for each rule in "Windows Defender Firewall with Advanced Security".




                                    To run Windows Defender Firewall with Advanced Security


                                    Run the following in an Administrative Powershell window ... to review possible rules:

                                    "C:WINDOWSsystem32mmc.exe" "C:WINDOWSsystem32wf.msc" 



                                    To allow access for File/Print only on private network



                                    Run the following in an Administrative Powershell window.



                                    # Allow access to administrative shares through firewall [Ref: https://serverfault.com/a/739272]
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv4-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv6-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (LLMNR-UDP-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Datagram-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Name-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Session-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC-EPMAP)" dir=in profile=private new enable=Yes





                                    share|improve this answer













                                    Building on @Mulder's answer, to enable it for private mode, it needs to be set specifically for each rule in "Windows Defender Firewall with Advanced Security".




                                    To run Windows Defender Firewall with Advanced Security


                                    Run the following in an Administrative Powershell window ... to review possible rules:

                                    "C:WINDOWSsystem32mmc.exe" "C:WINDOWSsystem32wf.msc" 



                                    To allow access for File/Print only on private network



                                    Run the following in an Administrative Powershell window.



                                    # Allow access to administrative shares through firewall [Ref: https://serverfault.com/a/739272]
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv4-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Echo Request - ICMPv6-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (LLMNR-UDP-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Datagram-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Name-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (NB-Session-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC)" dir=in profile=private new enable=Yes
                                    netsh advfirewall firewall set rule name="File and Printer Sharing (Spooler Service - RPC-EPMAP)" dir=in profile=private new enable=Yes






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered May 21 at 23:39









                                    CJBSCJBS

                                    1216




                                    1216



























                                        draft saved

                                        draft discarded
















































                                        Thanks for contributing an answer to Server Fault!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid


                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.

                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f516920%2fenable-file-and-print-sharing-command-line-how-to-enable-it-just-for-profile-p%23new-answer', 'question_page');

                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                                        Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                                        Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020