Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Find-AzureVmKnownIssuesWindows.ps1 #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rafamarrara
Copy link

Adding Find-AzureVmKnownIssuesWindows.ps1 which will help troubleshoot unable to RDP issues for Windows VMs when using Serial Console on Azure Portal


#
# RDP settigns

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

$Current = (Get-ItemProperty HKLM:\SYSTEM\Select -Name Current).Current
if ($null -eq $Current)
{
$Current = 1 # dafault
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Find-AzureVmKnownIssuesWindows.ps1 Show resolved Hide resolved
Write-Host ("`nWARN | Deny RDP Connections`n RDP is set to deny connections, current value of 'fDenyTSConnections' is '{0}'`n Run the following commands to fix this problem: (copy & paste line by line)`n >`n `$reg='HKLM:\System\ControlSet00$Current\Control\Terminal Server'`n Set-ItemProperty -Path `$reg -Name 'fDenyTSConnections' -Value 0`n" -f $RDPSettings.fDenyTSConnections) -ForegroundColor Yellow
}

# if PortNumber is not 3380 then RDP is not using the default port
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3389

Find-AzureVmKnownIssuesWindows.ps1 Show resolved Hide resolved
Find-AzureVmKnownIssuesWindows.ps1 Show resolved Hide resolved
Write-Host ("`nWARN | RDP is listening on a specific NIC `n Remore Desktop is listening on NIC '{0}', by default RDP listen on all NICs`n Run the following commands to fix this problem: (copy & paste line by line)`n >`n `$reg='HKLM:\SYSTEM\ControlSet00$Current\Control\Terminal Server\WinStations\RDP-Tcp'`n Set-ItemProperty -Path `$reg -Name 'LanAdapter' -Value 0`n Restart-Service TermService -Force`n" -f $RDPSettings.LanAdapter) -ForegroundColor Yellow
}

# RDP settigns
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo. Did you actually mean to have the same heading again here? I see you do that consistently below. Perhaps there is a open/close section syntax?

elseif ($nics.Count -eq 1)
{
# netconnectionstatus = 2 > Connected
if ($nics[0].netconnectionstatus -ne 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use an enum above so you could do something like [NicStatus]::Connected? Likely would make it easier to read

Find-AzureVmKnownIssuesWindows.ps1 Show resolved Hide resolved
# if PortNumber is not 3380 then RDP is not using the default port
if ($RDPSettings.PortNumber -ne 3389)
{
Write-Host ("`nWARN | RDP is not using default Port`n Remore Desktop is set use '{0}' Port, the default RDP port is '3389'`n Run the following commands to fix this problem: (copy & paste line by line)`n >`n `$reg='HKLM:\SYSTEM\ControlSet00$Current\Control\Terminal Server\WinStations\RDP-Tcp'`n Set-ItemProperty -Path `$reg -Name 'PortNumber' -Value 3389`n Restart-Service TermService -Force`n" -f $RDPSettings.PortNumber) -ForegroundColor Yellow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

port instead of capital Port a couple times

Copy link
Contributor

@CraigWiand CraigWiand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM as an initial commit but I did not perform test runs on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants