Enable and Disable RDP NLA using PowerShell

Source: Internet
Author: User

Enable_rdp_nla

#Powershell script to enable Network level authentication for Remote Desktop Services connections#the need arose when tryi Ng to RDP using a third party application and it gave the following error: #The remote computer ' <machine name> ' requ Ires Network level Authentication, which your computer does isn't support. #The following script have to is run on the remote Machine using RDC (Remote Desktop Connection) on which you is attempting to RDP to and gives the error.# Post this you sh Ould be able to successfully run RDP using the third party application.# comparative. Reg script is as below:# Windows reg Istry Editor Version 5.00# [hkey_local_machine\system\currentcontrolset\control\terminal server\winstations\rdp-tcp ]# "UserAuthentication" =dword:00000000# "Securitylayer" =dword:00000000# author-vikram Bedi # [email protected] # Powershell v2.0#v1.0 Initial script$registrypath = "Hklm:\system\currentcontrolset\control\terminal Server\ Winstations\rdp-tcp "$Name 1 =" UserAuthentication "$value 1 = "00000001" IF (! ( Test-path $registryPath)) {New-item-path $registryPath-force | Out-null new-itemproperty-path $registryPath-name $name 1-value $value 1-propertytype Dword-force | Out-null} ELSE {new-itemproperty-path $registryPath-name $name 1-value $value 1-propertytype Dword-force | Out-null} $Name 2 = "Securitylayer" $value 2 = "00000001" IF (! ( Test-path $registryPath)) {New-item-path $registryPath-force | Out-null new-itemproperty-path $registryPath-name $name 2-value $value 2-propertytype Dword-force | Out-null} ELSE {new-itemproperty-path $registryPath-name $name 2-value $value 2-propertytype Dword-force | Out-null}

Disable_rdp_nla

#Powershell script to enable Network level authentication for Remote Desktop Services connections#the need arose when tryi Ng to RDP using a third party application and it gave the following error: #The remote computer ' <machine name> ' requ  Ires Network level Authentication, which your computer does not support.# the following script have to is run on the remote Machine using RDC (Remote Desktop Connection) on which you is attempting to RDP to and gives the error.# Post so you s Hould be able to successfully run RDP using the third party application.# comparative. Reg script is as below:# Windows Re Gistry Editor Version 5.00# [hkey_local_machine\system\currentcontrolset\control\terminal server\winstations\ rdp-tcp]# "UserAuthentication" =dword:00000000# "Securitylayer" =dword:00000000# author-vikram Bedi # [email  Protected] #Powershell v2.0#v1.0 Initial script$registrypath = "hklm:\system\currentcontrolset\control\terminal Server\winstations\rdp-tcp "$Name 1 =" userauthentication"$value 1 =" 00000000 "IF (! ( Test-path $registryPath)) {New-item-path $registryPath-force | Out-null new-itemproperty-path $registryPath-name $name 1-value $value 1-propertytype Dword-force | Out-null} ELSE {new-itemproperty-path $registryPath-name $name 1-value $value 1-propertytype Dword-force | Out-null} $Name 2 = "Securitylayer" $value 2 = "00000000" IF (! ( Test-path $registryPath)) {New-item-path $registryPath-force | Out-null new-itemproperty-path $registryPath-name $name 2-value $value 2-propertytype Dword-force | Out-null} ELSE {new-itemproperty-path $registryPath-name $name 2-value $value 2-propertytype Dword-force | Out-null}

Enable and Disable RDP NLA using PowerShell

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.