shalu
shalu

Reputation: 3

Disable Network Level Security on my Azure Virtual machine remotely

Whenever I try to login in my Server I get following error The remote computer that you are trying to connect to requires Network Level Authentication (NLA), but your Windows domain controller cannot be contacted to perform NLA. If you are an administrator on the remote computer, you can disable NLA by using the options on the Remote tab of the System Properties dialog box.

I cant connect to my server remotely using powershell and Remote registry(regedit) inspite of enabling TCP port 5986. Can any one suggest a solution.

Upvotes: 0

Views: 20986

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28244

There is an easy method to disable NLA via the Azure portal. You can navigate the Operation---Run command---select the DisableNLA script, then click Run button after finishing the run command script, restart your Azure VM for the change to take effect.

enter image description here

Alternatively, you also could invoke run command with PowerShell or Azure CLI.

https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command

For example

Run these PowerShell scripts to disable or enable the NLA of the remote computer on the local machine with Invoke-AzVMRunCommand -ResourceGroupName '<myResourceGroup>' -Name '<myVMName>' -CommandId 'RunPowerShellScript' -ScriptPath '<pathToScript>' -Parameter @{"arg1" = "var1";"arg2" = "var2"}

$ComputerName = "remote computer"

# Getting the NLA information
(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -ComputerName $ComputerName -Filter "TerminalName='RDP-tcp'").UserAuthenticationRequired

# Setting the NLA information to Disabled
(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -ComputerName $ComputerName -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0)

# Setting the NLA information to Enabled
(Get-WmiObject -class "Win32_TSGeneralSetting" -Namespace root\cimv2\terminalservices -ComputerName $ComputerName -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(1)


# -Parameter @{"arg1" = "var1";"arg2" = "var2"}

Result

enter image description here

Upvotes: 7

Related Questions