关闭NLA`
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
$Name1 = "UserAuthentication"
$value1 = "00000000"
IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name1 -Value $value1 -PropertyType DWORD -Force | Out-Null
}
ELSE
{
New-ItemProperty -Path $registryPath -Name $name1 -Value $value1 -PropertyType DWORD -Force | Out-Null
}
$Name2 = "SecurityLayer"
$value2 = "00000000"
IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name2 -Value $value2 -PropertyType DWORD -Force | Out-Null
}
ELSE
{
New-ItemProperty -Path $registryPath -Name $name2 -Value $value2 -PropertyType DWORD -Force | Out-Null
}
开启NLA
$registryPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
$Name1 = "UserAuthentication"
$value1 = "00000001"
IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name1 -Value $value1 -PropertyType DWORD -Force | Out-Null
}
ELSE
{
New-ItemProperty -Path $registryPath -Name $name1 -Value $value1 -PropertyType DWORD -Force | Out-Null
}
$Name2 = "SecurityLayer"
$value2 = "00000001"
IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name2 -Value $value2 -PropertyType DWORD -Force | Out-Null
}
ELSE
{
New-ItemProperty -Path $registryPath -Name $name2 -Value $value2 -PropertyType DWORD -Force | Out-Null
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)