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;
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
add a comment |
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
add a comment |
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
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
windows-firewall
asked Jun 19 '13 at 11:35
user1866880user1866880
2595818
2595818
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
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
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
add a comment |
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.
add a comment |
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.
add a comment |
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
what about if the entire group "File And Printer Sharing" does not exist inbound?
– Hicsy
Apr 15 at 3:04
add a comment |
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Nov 27 '15 at 7:40
HBruijn
58.4k1191155
58.4k1191155
answered Nov 27 '15 at 7:14
MulderMulder
411
411
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited May 11 '17 at 9:28
Gerald Schneider
7,14832748
7,14832748
answered May 11 '17 at 9:27
MatiasMatias
1
1
add a comment |
add a comment |
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
what about if the entire group "File And Printer Sharing" does not exist inbound?
– Hicsy
Apr 15 at 3:04
add a comment |
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
what about if the entire group "File And Printer Sharing" does not exist inbound?
– Hicsy
Apr 15 at 3:04
add a comment |
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
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
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
add a comment |
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
add a comment |
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
add a comment |
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
add a comment |
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
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
answered May 21 at 23:39
CJBSCJBS
1216
1216
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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