Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PowerShell命令以打开";“Microsoft Networks的文件和打印共享”;在网络适配器上_Powershell_Network Programming - Fatal编程技术网

PowerShell命令以打开";“Microsoft Networks的文件和打印共享”;在网络适配器上

PowerShell命令以打开";“Microsoft Networks的文件和打印共享”;在网络适配器上,powershell,network-programming,Powershell,Network Programming,是否有PowerShell命令/代码在网络适配器上打开“Microsoft网络的文件和打印共享” 我找到了以下链接,其中显示了powershell代码,可在防火墙(选项3)而不是网卡(选项4)上打开“文件和打印共享” 我发现我可以使用文件drfpshare.exe和参数/on来打开它。如果可能的话,我倾向于使用直接的PowerShell代码,但如果我必须使用二进制代码,我可以让它工作 最后一点需要注意的是,该命令/代码需要与PowerShell 2及更高版本一起使用。请尝试: Enable-Ne

是否有PowerShell命令/代码在网络适配器上打开“Microsoft网络的文件和打印共享”

我找到了以下链接,其中显示了powershell代码,可在防火墙(选项3)而不是网卡(选项4)上打开“文件和打印共享”

我发现我可以使用文件
drfpshare.exe
和参数
/on
来打开它。如果可能的话,我倾向于使用直接的PowerShell代码,但如果我必须使用二进制代码,我可以让它工作

最后一点需要注意的是,该命令/代码需要与PowerShell 2及更高版本一起使用。

请尝试:

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

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