使用powershell 开启或关闭NLA

2023-05-16

关闭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(使用前将#替换为@)

使用powershell 开启或关闭NLA 的相关文章

  • spring事务相关配置之rollback

    文章目录 1 概述2 环境准备3 使用 96 rollbackFor 96 1 概述 我们知道当开启spring事务后 xff0c 如果出现异常 xff0c 那么数据库数据会进行回滚 但是并不是所有异常都会回滚因此我们可以使用rollbac
  • ios 音频录音、上传至7牛、播放及其与android兼容的问题

    iOS录音使用AVAudioRecorder xff0c 播放用 AVPlayer 就可以很好的解决 xff0c 网上也有很多的教程 这里就不细讲 xff0c 后面会附上代码 先说一下demo内容 xff0c 现在项目要求做一个录音 上传
  • 数据库

    1 查询选修1号课程的学生学号和成绩 xff0c 并要求对查询结果按成绩的降序排列 xff0c 如果成绩相同则按学号的升序排列 Select sno grade From sc Where cno 61 1 Order by grade D
  • linux内存测试工具memtester使用详解

    memtester官网 xff1a http pyropus ca software memtester linux安装 xff1a 下载安装包 1 wget http pyropus ca software memtester old v
  • Mybatis-plus使用pagehelper进行分页

    DROP TABLE IF span class token class name EXISTS span user span class token punctuation span CREATE span class token cla
  • Linux系统迁移(将配置好的系统安装到其它电脑上)

    Linux系统迁移 说在前面 xff1a 下面有几个教程链接 xff0c 我都是通过这几个链接来完成的系统备份与系统恢复 并且遇到过一些问题 xff0c 踩过一些坑 建议先看完我的说明再进行操作 xff0c 少走弯路 没有图是因为下面分享的
  • Linux上用code blocks写fortran代码

    Linux上用code blocks写fortran代码 用GNU带的fortran编译器编译 xff0c 居然出现错误 xff0c undifined reference to gfortran write st 在我删掉了这个proje
  • 字符串相关操作————2015小米笔试内容

    这个是一道小米公司2015的笔试题 xff1a 回文数 xff1a 一个字符串从前看和从后看如果一样的话 xff0c 就是回文串 比如 上海自来水来自上海 就是一个回文串 现在 xff0c 把一个数字看成一个字符串 xff0c 问他是不是一
  • 信息学奥赛C++语言:百钱买百鸡

    题目描述 百钱买百鸡问题 鸡翁一 xff0c 值钱五 xff0c 鸡母一 xff0c 值钱三 xff0c 鸡雏三 xff0c 值钱一 xff0c 百钱买百鸡 xff0c 问鸡翁 鸡母 鸡雏各几何 xff1f xff08 公鸡一只5块 xff
  • 业务运营支撑系统  BOSS(Business & Operation Support System)。

    BOSS名称是由中国移动联合多家咨询公司为传统电信企业 计费系统起的专门名称 xff0c 是世界上第一个对电信计费系统命名并制定相关标准 该系统由电信部门的计费系统发展而来 xff0c 基本功能包括用户资料管理 计费 出帐 结算等 xff0
  • 【C语言】10个数字按照从小到大进行排序(冒泡法)

    include lt stdio h gt main int a 10 61 5 2 4 25 13 11 7 8 0 12 需要进行排序的10个数字 int i j t for i 61 1 i lt 10 i 43 43 for j 6
  • 解决VS2015无法打开WinSock2.h,无法找到ws2_32.lib

    现象 xff1a VS2015无法找到ws2 32 lib xff0c 无法打开WinSock2 h以及nldef h文件 项目使用的SDK是Windows 8 1 SDK xff0c 使用everything在本地搜了一下确实没有找到8
  • apache-options配置之Indexes

    配置 Options Indexes FollowSymLinks Indexs的配置的作用是如果不存在Index html文件的时候 xff0c 将该目录下的文件树列出来 一般在线上使用
  • Ubuntu-有线网络无法上网的问题解决方法汇总

    转载别人的 xff0c 写的很详细很全 xff0c 值得收藏 https blog csdn net u010025211 article details 75043216 另外 xff0c 说一下在设置静态IP时 xff0c 点击右上角的
  • 【跨域问题】Access to XMLHttpRequest at ‘http://xxxx.com/xxx’ from origin ‘null’ has been blocked by

    错误描述 xff1a 项目中写了一个上传图片的接口 xff1b 给到别人使用出现这个错误 xff0c 具体分析原来是跨域报错 xff1b ajax调用接口出现 xff1a Access to XMLHttpRequest at http x
  • 搭建 公网FTP服务器 外网访问

    我是在ubuntu 20 04 上配置的 xff0c 需要用到公网IP 没有公网IP的 xff0c 可以考虑花生壳这类应用来做内网穿透 1 配置FTP服务器 安装vsftpd sudo apt install vsftpd sudo vim
  • sqlserver解析json

    create table a json varchar 200 insert into a values 39 34 name 34 34 test 34 34 sex 34 34 男 34 39 判断是否是json xff0c 如果不判断
  • 七牛云配置怎么配CDN

    对象存储 1 1新建空间 xff08 创建空间 xff0c 例如img video txt仓库 xff09 2 融合cdn 2 1域名管理 2 2添加域名 2 3创建域名 域名类型 普通 加速域名 新二级域名 通信协议 先用http建立起此
  • Apache 中文目录浏览乱码解决办法

    http www cnitblog com 201 archive 2010 04 14 65277 html 最近打算建立一个分享资源的网络空间 xff0c 想使用FTP xff0c 但是又觉得不算好用 于是就直接使用Apache的Ind
  • Linux 休眠

    http hi baidu com red woods blog item 721676123f5ced56f819b8d5 html Linux休眠 STD 有shutdown和platform两种方式 xff0c platform需要B

随机推荐