You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analyzes current device regarding the possibility to use Delivery Optimization.
5
+
6
+
.Description
7
+
Delivery Optimization is the built-in feature to optimize data traffic and a lot of Microsoft products and services are using it. Therefore it's crucial, that you are aware of the status in your environment.
8
+
9
+
Returns array of Messages with four properties:
10
+
11
+
- Testname: Name of the Tets
12
+
- Type: Information, Warning or Error
13
+
- Issue: Description of the issue
14
+
- Possible Cause: Tips on how to solve the issue.
15
+
16
+
.Example
17
+
# Displays a deep analyisis of the currently found issues in the system.
$possibleErrors+=New-AnalyzeResult-TestName "Service"-Type Error -Issue "The Delivery Optimization Service (DoSvc) is not running on the system."-PossibleCause "Try to to start it again `nStart-Service -Name DoSvc"
29
+
} else {
30
+
$possibleErrors+=New-AnalyzeResult-TestName "Service"-Type Error -Issue "The Delivery Optimization Service (DoSvc) is not running on the system and the start type is not 'Automatic', therefore an administrator has changed this behavior."-PossibleCause "Chnage the startup type to automatic and start the service. `nSet-Service -Name DoSvc -StartupType Automatic`nStart-Service -Name DoSvc"
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "Not all Windows Firewall profiles are enabled. Therefore, the other FIrewall related warnings can be incorrect, because the profile in the network you would like to use DO is disabled and therefore the firewall rules are not needed."-PossibleCause "Check if a Firewall Profile is used in your network or not. If not, then you can ignore the other Firewall related issues."
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "Not all default Firewall Rules(DeliveryOptimization-UDP-In, DeliveryOptimization-TCP-In) regarding Delivery Optimization are found on your system."-PossibleCause "Perhaps you or another administrator has created custom rules and enabled them. These should allow incoming TCP/UDP 7680 connections on the peers. `n You can verify the connection to a peer by using the following command:`n Test-NetConnection -ComputerName %ipofpeer% -Port 7680"
42
+
} else {
43
+
if($FwRules[0].Profile -ne"Any"){
44
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[0].Name) is not aplied to all profiles(Public, Private, Domain)."-PossibleCause "Check if the you are using DO in a network which is not assigned to a profile where the rule is active($($FwRules[0].Profile))."
45
+
}
46
+
if($FwRules[1].Profile -ne"Any"){
47
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[1].Name) is not aplied to all profiles(Public, Private, Domain)."-PossibleCause "Check if the you are using DO in a network which is not assigned to a profile where the rule is active($($FwRules[1].Profile))."
48
+
}
49
+
if($FwRules[0].Action -ne"Allow"){
50
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[0].Name) does not Allow the Traffic."-PossibleCause "Change the Action to Allow in the rule."
51
+
}
52
+
if($FwRules[1].Action -ne"Allow"){
53
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[1].Name) does not Allow the Traffic."-PossibleCause "Change the Action to Allow in the rule."
54
+
}
55
+
if($FwRules[0].Direction -ne"Inbound"){
56
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[0].Name) does not target inbound traffic."-PossibleCause "Change the Direction to inbound in the rule."
57
+
}
58
+
if($FwRules[1].Direction -ne"Inbound"){
59
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[1].Name) does not target inbound traffic."-PossibleCause "Change the Direction to inbound in the rule."
60
+
}
61
+
if($FwRules[0].Enabled -ne$true){
62
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[0].Name) is not enabled."-PossibleCause "Enable the rule."
63
+
}
64
+
if($FwRules[1].Enabled -ne$true){
65
+
$possibleErrors+=New-AnalyzeResult-TestName "Firewall"-Type Warning -Issue "The rule $($FwRules[1].Name) is not enabled."-PossibleCause "Enable the rule."
66
+
}
67
+
}
68
+
69
+
Write-Verbose"Conenctivity Tests to Delivery Optimization Service"
$data.Add(@{ TestUrl='https://geo-prod.do.dsp.mp.microsoft.com'; UrlPattern='https://*.do.dsp.mp.microsoft.com'; ExpectedStatusCode=403; Description='Updates for applications and the OS on Windows 10 1709 and later. Windows Update Delivery Optimization metadata, resiliency, and anti-corruption.'; PerformBluecoatLookup=$false; Verbose=$false }) # many different *-prod.do.dsp.mp.microsoft.com, but geo-prod.do.dsp.mp.microsoft.com is the most common one
$possibleErrors+=New-AnalyzeResult-TestName "Connectivity"-Type "Error"-Issue "Connection blocked `n$($connectivity)"-PossibleCause "Firewall is blocking connection to '$($connectivity.UnblockUrl)'. Delivery Optimization contacts a cloud service for a list of peers. This service uses HTTPS to *.do.dsp.mp.microsoft.com (communication to this service has to be allowed outbound to the Internet even if only local sharing is enabled)."
82
+
}
83
+
if ($connectivity.Resolved-eq$false) {
84
+
$possibleErrors+=New-AnalyzeResult-TestName "Connectivity"-Type "Error"-Issue "DNS name not resolved `n$($connectivity)"-PossibleCause "DNS server not correctly configured."
85
+
}
86
+
if ($connectivity.ActualStatusCode-ne$connectivity.ExpectedStatusCode) {
87
+
if($connectivity.ActualStatusCode-eq407){
88
+
$Cause="Keep in mind that the proxy has to be set in WinHTTP.`nWindows 1709 and newer: Set the proxy by using netsh or WPAD. --> https://docs.microsoft.com/en-us/windows/desktop/WinHttp/winhttp-autoproxy-support `nWindows 1709 and older: Set the proxy by using 'netsh winhttp set proxy ?' --> https://blogs.technet.microsoft.com/netgeeks/2018/06/19/winhttp-proxy-settings-deployed-by-gpo/ "
89
+
} else {
90
+
$Cause="Interfering Proxy server can change HTTP status codes."
91
+
}
92
+
$possibleErrors+=New-AnalyzeResult-TestName "Connectivity"-Type "Error"-Issue "Returned HTTP Status code '$($connectivity.ActualStatusCode)' is not expected '$($connectivity.ExpectedStatusCode)'`n$($connectivity)"-PossibleCause $Cause
93
+
}
94
+
if ($null-ne$connectivity.ServerCertificate-and$connectivity.ServerCertificate.HasError) {
95
+
$possibleErrors+=New-AnalyzeResult-TestName "Connectivity"-Type "Error"-Issue "Certificate Error when connecting to $($connectivity.TestUrl)`n$(($connectivity.ServerCertificate))"-PossibleCause "Interfering Proxy server can change Certificate or not the Root Certificate is not trusted."
$possibleErrors += New-AnalyzeResult -TestName "Configuration" -Type "Error" -Issue "A policy is disabling Delivery Optimization and enforce mode $PolicyDODownloadMode. 0=HTTP only, no peering. 1=HTTP blended with peering behind the same NAT. 2=HTTP blended with peering across a private group. Peering occurs on devices in the same Active Directory Site (if exist) or the same domain by default. When this option is selected, peering will cross NATs. To create a custom group use Group ID in combination with Mode 2. 3=HTTP blended with Internet Peering. 99=Simple download mode with no peering. Delivery Optimization downloads using HTTP only and does not attempt to contact the Delivery Optimization cloud services. 100=Bypass mode. Do not use Delivery Optimization and use BITS instead." -PossibleCause "Change the assigned GPO or the local GPO and switch to mode 1,2 or 3. You can find the setting in the following path in GPO: `nComputer Configuration > Policies > Administrative Templates > Windows Components > Delivery Optimization > Download Mode"
$possibleErrors += New-AnalyzeResult -TestName "Configuration" -Type "Error" -Issue "The Actual used configuration is disabling Delivery Optimization and uses mode $ConfigDODownloadMode. 0=HTTP only, no peering. 1=HTTP blended with peering behind the same NAT. 2=HTTP blended with peering across a private group. Peering occurs on devices in the same Active Directory Site (if exist) or the same domain by default. When this option is selected, peering will cross NATs. To create a custom group use Group ID in combination with Mode 2. 3=HTTP blended with Internet Peering. 99=Simple download mode with no peering. Delivery Optimization downloads using HTTP only and does not attempt to contact the Delivery Optimization cloud services. 100=Bypass mode. Do not use Delivery Optimization and use BITS instead." -PossibleCause "If you don't have any other warning regarding configuration from GPO or SettingsAppChange, then change the registry value to mode 1,2 or 3.`nHKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config `nValueName: DODownloadMode"
$possibleErrors+=New-AnalyzeResult-TestName "Configuration"-Type "Error"-Issue "The user has disabled Delivery Optimization through the settings app and set mode $UserSettingsDODownloadMode. 0=HTTP only, no peering. 1=HTTP blended with peering behind the same NAT. 2=HTTP blended with peering across a private group. Peering occurs on devices in the same Active Directory Site (if exist) or the same domain by default. When this option is selected, peering will cross NATs. To create a custom group use Group ID in combination with Mode 2. 3=HTTP blended with Internet Peering. 99=Simple download mode with no peering. Delivery Optimization downloads using HTTP only and does not attempt to contact the Delivery Optimization cloud services. 100=Bypass mode. Do not use Delivery Optimization and use BITS instead."-PossibleCause "Open the Settings App and search for Delivery Optmization and enable it."
111
+
}
112
+
# No errors detected, return success message
113
+
if ($possibleErrors.Count-eq0) {
114
+
$possibleErrors+=New-AnalyzeResult-TestName "All"-Type Information -Issue "All tests went through successfully."-PossibleCause ""
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
0 commit comments