Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/modules/SdnDiag.Health.Config.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
Impact = "You may not achieve optimal performance for network traffic flowing through the SDN Node(s)."
PublicDocUrl = ""
}
'Test-SdnGatewayRemoteAccessCimClass' = @{
FriendlyName = "Gateway RemoteAccess CIM Class"
Description = "Ensure that the PS_RemoteAccess CIM class is accessible in the root/microsoft/windows/remoteaccess namespace on Gateway node(s)."
Impact = "Gateway functionality may be impacted if the RemoteAccess WMI provider is not installed or operational."
PublicDocUrl = ""
}

# LOAD BALANCER MUX TESTS

Expand Down
33 changes: 31 additions & 2 deletions src/modules/SdnDiag.Health.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,7 @@ function Debug-SdnGateway {
Test-SdnNonSelfSignedCertificateInTrustedRootStore @PSBoundParameters
Test-SdnDiagnosticsCleanupTaskEnabled -TaskName 'SDN Diagnostics Task' @PSBoundParameters
Test-SdnAdapterPerformanceSetting @PSBoundParameters
Test-SdnGatewayRemoteAccessCimClass @PSBoundParameters
)

foreach ($service in $services) {
Expand Down Expand Up @@ -1122,7 +1123,7 @@ function Test-SdnNetworkControllerApiNameResolution {
}
catch {
$_ | Trace-Exception
"Investigate DNS resolution failure against DNS server {0} for name {1}" -f $dnsServer, $Endpoint
"Failed to resolve {0} from {1}. Exception: {2}" -f $Endpoint, $dnsServer, $_.Exception.Message
}
}

Expand Down Expand Up @@ -2076,4 +2077,32 @@ function Test-SdnAdapterPerformanceSetting {
}

return $sdnHealthTest
}
}

function Test-SdnGatewayRemoteAccessCimClass {
<#
.SYNOPSIS
Validates that the RemoteAccess CIM class is accessible on the Gateway node.
#>

[CmdletBinding()]
param ()

$sdnHealthTest = New-SdnHealthTest
try {
try {
$null = Get-CimClass -Namespace 'root/microsoft/windows/remoteaccess' -ClassName 'PS_RemoteAccess' -ErrorAction Stop
}
catch {
$_ | Trace-Exception
$sdnHealthTest.Result = 'FAIL'
$sdnHealthTest.Remediation += "Ensure the RemoteAccess role is installed. Run 'Install-WindowsFeature -Name RSAT-RemoteAccess-PowerShell' to install missing WMI class"
}
}
catch {
$_ | Trace-Exception
$sdnHealthTest.Result = 'UNKNOWN'
}

return $sdnHealthTest
}
Loading