Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell command to turn on "File and Print Sharing for Microsoft Networks" on a network adapter

Is there PowerShell command/code to turn on "File and Print Sharing for Microsoft Networks" on a network adapter?

I found the following link How to Turn On or Off File and Printer Sharing in Windows 10 that shows powershell code to turn on "File and Print Sharing" at the firewall (Option 3) but not at the network card (Option 4).

I have found that I can use the file drfpshare.exe with the argument /on to turn it on. My preference would be to use straight PowerShell code if possible but if I must use a binary I can make it work.

And the last caveat, the command/code needs to work with PowerShell 2 and above.

like image 561
Keith Avatar asked Jan 20 '26 04:01

Keith


1 Answers

Try:

Enable-NetAdapterBinding -Name "Network Adapter Name" -DisplayName "File and Printer Sharing for Microsoft Networks"

There is also:

Disable-NetAdapterBinding -Name "Network Adapter Name" -DisplayName "File and Printer Sharing for Microsoft Networks"
like image 150
xyz Avatar answered Jan 21 '26 18:01

xyz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!