以管理员身份运行PowerShell,执行下面3行语句即可将所有网络接口归为工作网络:
$networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}")) $connections = $networkListManager.GetNetworkConnections() $connections | % { $_.GetNetwork().SetCategory(1)}
如果把最后一行里SetCategory(1)改成SetCategory(0)则是全归为公用网络。
来自:https://blog.csdn.net/w504430863/article/details/42964133
转载于:https://www.cnblogs.com/784040932/p/win10-network-type.html