question

HiiSingChung-5822 avatar image
0 Votes"
HiiSingChung-5822 asked CandyLuo-MSFT answered

netsh advfirewall firewall to change an existing rule's remoteip

I would like to make a change to an existing Windows Firewall rule, the 'File and Printer Sharing (SMB-in)" private profile remoteip. By default Windows set the private profile remoteip to 'localsubnet', I want to change this to 'any'. I have thousands of Windows computers on the network and I find that they randomly set their network profile to private or public and I don't know the reason behind them. I have tried to use the set-netconnectionprofile to change their network profile to private or public, vice versa but I find that after restart their revert the netconnectionprofile. Because of this problem, I would like to change the default rule of the "File and Printer Sharing (SMB-in)" remoteip to any on the private profile if a computer keeps setting its network connection profile to private. I had tried these: netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-in)" profile=private remoteip=any This shows error "For 'set' command, the 'new' keyword must be present and must not be the last argument provided. netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-in)" profile=private new remoteip=any This shows error "No rule match the specified criteria". What need to be done to make it correct?

windows-10-network
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CandyLuo-MSFT avatar image
0 Votes"
CandyLuo-MSFT answered

Hi ,

Please run the command of netsh advfirewall firewall set rule name="File and Printer Sharing (SMB-In)" new profile=private remoteip=any , as picture below:

82663-image.png

Best Regards,
Candy


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.






image.png (120.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.