Inq*_*Shm 46 networking windows windows-10
我的笔记本电脑有 Wi-Fi 和以太网(对接时)。出于某种原因,Wi-Fi 作为Private network 出现,docked 作为Public 出现。在这两种情况下,我都没有设置为Private或Public。
我在 Windows 10 上在哪里设置它?好像我在这里遗漏了一些东西......
Run*_*n5k 35
我认为将网络更改为私有的最简单方法是通过注册表编辑器:
(来源:如何在 Windows 10 中将网络位置设置为公共或私有)
Lot*_*ngs 32
下面的小 PowerShell 脚本可以执行相同的操作(它还需要管理员权限)。
它将列出所有非私人资料,并要求确认将其更改为私人资料。
## Change NetWorkConnection Category to Private
#Requires -RunasAdministrator
Get-NetConnectionProfile |
Where{ $_.NetWorkCategory -ne 'Private'} |
ForEach {
$_
$_|Set-NetConnectionProfile -NetWorkCategory Private -Confirm
}
Run Code Online (Sandbox Code Playgroud)
我的德语语言环境系统上的示例输出:
Name : Netzwerk
InterfaceAlias : Ethernet
InterfaceIndex : 3
NetworkCategory : Public
IPv4Connectivity : Internet
IPv6Connectivity : Internet
Bestätigung
Möchten Sie diese Aktion wirklich ausführen?
[J] Ja [A] Ja, alle [N] Nein [K] Nein, keine [H] Anhalten [?] Hilfe (Standard ist "J"): K
Run Code Online (Sandbox Code Playgroud)
编辑这是英文确认文本:
Confirm
Are you sure you want to perform this action?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): n
Run Code Online (Sandbox Code Playgroud)
Adi*_*oon 17
您可以使用 Powershell 命令来执行此操作:
powershell.exe并点击Ctrl+Shift+Enter(以管理员身份打开)Network_Name为所选网络)
Set-NetConnectionProfile -Name "Network_Name" -NetworkCategory Private
Run Code Online (Sandbox Code Playgroud)
如果你不是已经在一个专用网络,这是最快和最简单的方法:
或者,您可以使用 PowerShell:
获取-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private
如果您有多个连接并且您不希望其中一些连接是私有的,您可以有选择地设置它们:
PS C:\> Get-NetConnectionProfile 名称 : 网络 接口别名:以太网 1 接口索引:11 网络类别:公共 IPv4连接:本地网络 IPv6 连接:本地网络 名称 : 不明网络 接口别名:以太网 2 接口索引:4 网络类别:公共 IPv4连接:本地网络 IPv6 连接:本地网络
Set-NetConnectionProfile -InterfaceAlias "Ethernet 1" -NetworkCategory Private
请注意,您永远不能手动将连接配置文件更改为网络类别DomainAuthenticated。如果你有一个应该设置为这个但没有设置的接口,那么你有一个更大的域连接问题在起作用。
| 归档时间: |
|
| 查看次数: |
88317 次 |
| 最近记录: |