Network and Internet Turn On or Off File and Printer Sharing in Windows 11


Network_and_Internet_banner.png

This tutorial will show you how to turn on or off file and printer sharing on your Windows 11 PC.

File and printer sharing is the ability of a computer running Windows to share a folder or attached printer with other computers on the same network.
  • File sharing allows you to make files and folders in a shared folder accessible to others on the same network to view, copy, or modify.
  • Printer sharing allows you to make an attached printer available to other computer users on the same network.
Windows creates a separate network profile for each network you use. You can turn on or off file and printer sharing separately for each Domain, Private, and Public network profile type.


You must be signed in as an administrator to turn on or off file and printer sharing.



Contents

  • Option One: Turn On or Off File and Printer Sharing in Settings
  • Option Two: Turn On or Off File and Printer Sharing in PowerShell




Option One

Turn On or Off File and Printer Sharing in Settings


1 Open Settings (Win+I).

2 Click/tap on Network & internet on the left side, and click/tap on Advanced network settings on the right side. (see screenshot below)

File_and_printer_sharing_Settings-1.png

3 Click/tap on Advanced sharing settings on the right side. (see screenshot below)


File_and_printer_sharing_Settings-2.png

4 Click/tap on Private networks and/or Public networks to expand open. (see screenshot below step 5)

5 Turn On or Off File and printer sharing for what you want for private and public networks.

File and printer sharing is turned off by default for public networks.

File and printer sharing is turned on by default for private networks.


File_and_printer_sharing_Settings-3.png

6 You can now close Settings if you like.




Option Two

Turn On or Off File And Printer Sharing in PowerShell


1 Open Windows Terminal (Admin), and select Windows PowerShell.

2 Do step 3 (on) or step 4 (off) below for what you want.


 3. Turn On File And Printer Sharing

A) Copy and paste the command below you want to use into the elevated PowerShell, press Enter, and go to step 5 below.

(Apply to all network profiles)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Any' | Set-NetFirewallRule -Enabled 'True'

OR​

(Apply to "Domain" network profile)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Domain' | Set-NetFirewallRule -Enabled 'True'

OR​

(Apply to "Private" network profile)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Private' | Set-NetFirewallRule -Enabled 'True'

OR​

(Apply to "Public" network profile)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Public' | Set-NetFirewallRule -Enabled 'True'


 4. Turn Off File And Printer Sharing

A) Copy and paste the command below into the elevated PowerShell, press Enter, and go to step 5 below. (see screenshot below)

(Apply to all network profiles)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Any' | Set-NetFirewallRule -Enabled 'False'

OR​

(Apply to "Domain" network profile)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Domain' | Set-NetFirewallRule -Enabled 'False'

OR​

(Apply to "Private" network profile)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Private' | Set-NetFirewallRule -Enabled 'False'

OR​

(Apply to "Public" network profile)
Get-NetFirewallRule -Group '*-28502*' | Where-Object 'Profile' -Match 'Public' | Set-NetFirewallRule -Enabled 'False'

5 You can now close the elevated PowerShell if you like.


That's it,
Shawn Brink


 
Last edited:
I have a question about the "Setup network connected devices automatically" check box.
Once I get my network with 3 Windows 11 PCs and maybe a Windows 10 PC, should I disable this option? I really don't want one computer modifying or changing settings in another...
Thanks Brink!
 

My Computer

System One

  • OS
    Windows 10 & 11 25H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Leo625`s Amazing Time Killers
    CPU
    AMD RYZEN 5 9500
    Motherboard
    GIGABYTE B650 AORUS Elite AX
    Memory
    MEM 2x8 G Corsair Vengeance
    Graphics Card(s)
    APU
    Sound Card
    Motherboard
    Monitor(s) Displays
    LG
    Screen Resolution
    1920 X 1080
    Hard Drives
    1TB Samsung 970 EVO Plus SSD
    PSU
    Corsair 750
    Case
    Old
    Cooling
    3 - 120MM Fans and Wraith Cooler for AM5
    Keyboard
    Wired and Lighted Logitech
    Mouse
    Wireless Logitech
    Internet Speed
    Decent
    Browser
    Firefox
I have a question about the "Setup network connected devices automatically" check box.
Once I get my network with 3 Windows 11 PCs and maybe a Windows 10 PC, should I disable this option? I really don't want one computer modifying or changing settings in another...
Thanks Brink!

Hello, :alien:

No worries. "Setup network connected devices automatically" will only affect your PC from automatically detecting connected network devices (ex: drive). Those devices don't modify anything on your PC.

You can turn it off though if not needed.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
Back
Top Bottom