This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathWindowsTelemetryConnectivity.psm1
77 lines (58 loc) · 4.94 KB
/
WindowsTelemetryConnectivity.psm1
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
Set-StrictMode -Version 4
Import-Module -Name HttpConnectivityTester -Force
# 1. import this file
# Import-Module .\WindowsTelemetryConnectivity.psm1
# 2. run one of the following:
# $connectivity = Get-WindowsTelemetryConnectivity
# $connectivity = Get-WindowsTelemetryConnectivity -Verbose
# $connectivity = Get-WindowsTelemetryConnectivity -PerformBlueCoatLookup
# $connectivity = Get-WindowsTelemetryConnectivity -Verbose -PerformBlueCoatLookup
# 3. filter results:
# $connectivity | Format-List -Property Blocked,TestUrl,UnblockUrl,DnsAliases,IpAddresses,Description,Resolved,ActualStatusCode,ExpectedStatusCode,UnexpectedStatus
# 4. save results to a file:
# Save-HttpConnectivity -Objects $connectivity -FileName ('WindowsTelemetryConnectivity_{0:yyyyMMdd_HHmmss}' -f (Get-Date))
Function Get-WindowsTelemetryConnectivity() {
<#
.SYNOPSIS
Gets connectivity information for Windows Telemetry.
.DESCRIPTION
Gets connectivity information for Windows Telemetry.
.PARAMETER PerformBlueCoatLookup
Use Symantec BlueCoat SiteReview to lookup what SiteReview category the URL is in.
.EXAMPLE
Get-WindowsTelemetryConnectivity
.EXAMPLE
Get-WindowsTelemetryConnectivity -Verbose
.EXAMPLE
Get-WindowsTelemetryConnectivity -PerformBlueCoatLookup
.EXAMPLE
Get-WindowsTelemetryConnectivity -Verbose -PerformBlueCoatLookup
#>
[CmdletBinding()]
[OutputType([System.Collections.Generic.List[pscustomobject]])]
Param(
[Parameter(Mandatory=$false, HelpMessage='Whether to perform a BlueCoat Site Review lookup on the URL. Warning: The BlueCoat Site Review REST API is rate limited.')]
[switch]$PerformBluecoatLookup
)
$isVerbose = $VerbosePreference -eq 'Continue'
$data = New-Object System.Collections.Generic.List[System.Collections.Hashtable]
# https://docs.microsoft.com/en-us/windows/privacy/configure-windows-diagnostic-data-in-your-organization#endpoints
$data.Add(@{ TestUrl = 'https://v10.vortex-win.data.microsoft.com/collect/v1'; ExpectedStatusCode = 400; Description = 'Diagnostic/telemetry data for Windows 10 1607 and later.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://v20.vortex-win.data.microsoft.com/collect/v1'; ExpectedStatusCode = 400; Description = 'Diagnostic/telemetry data for Windows 10 1703 and later.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://settings-win.data.microsoft.com'; ExpectedStatusCode = 404; Description = 'Used by applications, such as Windows Connected User Experiences and Telemetry component and Windows Insider Program, to dynamically update their configuration.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://watson.telemetry.microsoft.com'; ExpectedStatusCode = 404; Description = 'Windows Error Reporting.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://ceuswatcab01.blob.core.windows.net'; ExpectedStatusCode = 404; Description = 'Windows Error Reporting Central US 1.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://ceuswatcab02.blob.core.windows.net'; ExpectedStatusCode = 404; Description = 'Windows Error Reporting Central US 2.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://eaus2watcab01.blob.core.windows.net'; ExpectedStatusCode = 404; Description = 'Windows Error Reporting East US 1.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://eaus2watcab02.blob.core.windows.net'; ExpectedStatusCode = 404; Description = 'Windows Error Reporting East US 2.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://weus2watcab01.blob.core.windows.net'; ExpectedStatusCode = 404; Description = 'Windows Error Reporting West US 1.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://weus2watcab02.blob.core.windows.net'; ExpectedStatusCode = 404; Description = 'Windows Error Reporting West US 2.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://oca.telemetry.microsoft.com'; ExpectedStatusCode = 404; Description = 'Online Crash Analysis.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$data.Add(@{ TestUrl = 'https://vortex.data.microsoft.com/collect/v1'; ExpectedStatusCode = 400; Description = 'OneDrive app for Windows 10.'; PerformBluecoatLookup=$PerformBluecoatLookup; Verbose=$isVerbose })
$results = New-Object System.Collections.Generic.List[pscustomobject]
$data | ForEach-Object {
$connectivity = Get-HttpConnectivity @_
$results.Add($connectivity)
}
return $results
}