forked from kevinsul/stackhci-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhci-net-validator.ps1
132 lines (117 loc) · 6.18 KB
/
hci-net-validator.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
###############################################################################
#The purpose of this script is to verify that the servers you are looking to configure as Azure Stack HCI cluster nodes have the appropriate outbound
#connectivity needed to successfully register with Azure, deploy/register the AKS-HCI feature, download/update required PS modules, and register with the Arc RP.
#If any of these tests fail, appropriate changes should be made to the network to allow the failed connectivity.
#
#
#This script assumes that Azure Stack HCI OS has been installed and updated. The nodes should be members of the appropriate AD domain. This script should be executed
#from the intended jumpbox/WAC server that will be used to configure and deploy the Azure Stack HCI cluster.
#
# Modify the NODExx and ServerList variables below to map to the names of the target HCI nodes you are looking to deploy.
###############################################################################
#Set ServerList - if you have more (or less) nodes in your cluster, adjust this variable accordingly!
$ServerList = (Get-Clusternode).Name
###############################################################################
[array]$endpoints443 = "secure.aadcdn.microsoftonline-p.com",`
"aka.ms",`
"dev.applicationinsights.io",`
"www.azure.com",`
"dev.azurefd.net",`
"www.azure.net",`
"management.azure-api.net",`
"test.azuredatalakestore.net",`
"test.azureedge.net",`
"dev.loganalytics.io",`
"www.microsoft.com",`
"adminwebservice.microsoftonline.com",`
"aadcdn.msauth.net",`
"aadcdn.msftauth.net",`
"act.trafficmanager.net",`
"www.visualstudio.com",`
"www.windows.net",`
"aadwiki.windows-int.net",`
"85b0613f-326f-448c-a4ec-55ef8a1538aa.agentsvc.eus.azure-automation.net",`
"helm.sh",`
"storage.googleapis.com",`
"ecpacr.azurecr.io",`
"www.powershellgallery.com",`
"www.azurewebsites.net",`
"az764295.vo.msecnd.net"
[array]$endpoints80 = "secure.aadcdn.microsoftonline-p.com",`
"aka.ms",`
"dev.applicationinsights.io",`
"www.azure.com",`
"dev.azurefd.net",`
"www.azure.net",`
"management.azure-api.net",`
"test.azureedge.net",`
"dev.loganalytics.io",`
"www.microsoft.com",`
"adminwebservice.microsoftonline.com",`
"aadcdn.msauth.net",`
"aadcdn.msftauth.net",`
"act.trafficmanager.net",`
"www.visualstudio.com",`
"www.windows.net",`
"aadwiki.windows-int.net",`
"download.windowsupdate.com",`
"www.powershellgallery.com"
$endpoint9418 = "github.com"
######Test outbound connection from the local jumpbox/WAC instance#####
#Test outbound connection for port 443 endpoints
foreach($endpoint in $endpoints443) {
$Result = Test-NetConnection -ComputerName $endpoint -Port 443
if ($Result.TcpTestSucceeded -eq $false) {
Write-Host "Connection Test failed for" $endpoint "on port 443" -ForegroundColor Red
Write-Host "Host = " $env:COMPUTERNAME -ForegroundColor Red
Write-Host
}
}
#Test outbound connection for port 80 endpoints
foreach($endpoint in $endpoints80) {
$Result = Test-NetConnection -ComputerName $endpoint -Port 80
if ($Result.TcpTestSucceeded -eq $false) {
Write-Host "Connection Test failed for" $endpoint "on port 80" -ForegroundColor Red
Write-Host "Host = " $env:COMPUTERNAME -ForegroundColor Red
Write-Host
}
}
#Test outbound connection for port 9418 endpoint.
$Result = Test-NetConnection -ComputerName $endpoint9418 -Port 9418
if ($Result.TcpTestSucceeded -eq $false) {
Write-Host "Connection Test failed for" $endpoint9418 "on port 9418" -ForegroundColor Red
Write-Host "Host = " $env:COMPUTERNAME -ForegroundColor Red
Write-Host
}
#########################################################################
######Test outbound connection from each specified HCI node#####
#Test outbound connection for port 443 endpoints
Invoke-Command ($ServerList) {
foreach($endpoint in $using:endpoints443) {
$Result = Test-NetConnection -ComputerName $endpoint -Port 443
if ($Result.TcpTestSucceeded -eq $false) {
Write-Host "Connection Test failed for" $endpoint "on port 443" -ForegroundColor Red
Write-Host "Host = " $env:COMPUTERNAME -ForegroundColor Red
Write-Host
}
}
#Test outbound connection for port 80 endpoints
foreach($endpoint in $using:endpoints80) {
$Result = Test-NetConnection -ComputerName $endpoint -Port 80
if ($Result.TcpTestSucceeded -eq $false) {
Write-Host "Connection Test failed for" $endpoint "on port 80" -ForegroundColor Red
Write-Host "Host = " $env:COMPUTERNAME -ForegroundColor Red
Write-Host
}
}
#Test outbound connection for port 9418 endpoint.
$Result = Test-NetConnection -ComputerName $using:endpoint9418 -Port 9418
if ($Result.TcpTestSucceeded -eq $false) {
Write-Host "Connection Test failed for" $using:endpoint9418 "on port 9418" -ForegroundColor Red
Write-Host "Host = " $env:COMPUTERNAME -ForegroundColor Red
Write-Host
}
}
#########################################################################
Write-Host "TEST COMPLETE!"
pause