Skip to content

Commit

Permalink
New Windows Checks for WinHttpAutoProxySvc and iphlpsvc Services (#221)
Browse files Browse the repository at this point in the history
* NEw Windows Checks for WinHttpAutoProxySvc and iphlpsvc Services

* created 2 seperate checks for each services

* updated with minor changes

* changes made in the windows services

* changed the names of the checks.
  • Loading branch information
MainiSuruchi authored Jun 13, 2024
1 parent f66d3ae commit c3a04a1
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion AzFilesHybrid/AzFilesHybrid.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -3839,7 +3839,9 @@ function Debug-AzStorageAccountEntraKerbAuth {
"CheckEntraObject" = [CheckResult]::new("CheckEntraObject");
"CheckRegKey" = [CheckResult]::new("CheckRegKey");
"CheckKerbRealmMapping" = [CheckResult]::new("CheckKerbRealmMapping");
"CheckAdminConsent" = [CheckResult]::new("CheckAdminConsent")
"CheckAdminConsent" = [CheckResult]::new("CheckAdminConsent");
"CheckWinHttpAutoProxySvc" = [CheckResult]::new("CheckWinHttpAutoProxySvc");
"CheckIpHlpScv" = [CheckResult]::new("CheckIpHlpScv")
}
#
# Port 445 check
Expand Down Expand Up @@ -4061,6 +4063,65 @@ function Debug-AzStorageAccountEntraKerbAuth {
Debug-EntraKerbAdminConsent -StorageAccountName $StorageAccountName -checkResult $checks["CheckAdminConsent"]
}

#
# Check if WinHttpAutoProxySvc service is running
#
if (!$filterIsPresent -or $Filter -match "CheckWinHttpAutoProxySvc")
{
try
{
$checksExecuted += 1;
$service = Get-Service WinHttpAutoProxySvc
if (($service -eq $null) -or ($service.Status -ne "Running"))
{
$checks["CheckWinHttpAutoProxySvc"].Result = "Failed"
Write-Error "CheckWinHttpAutoProxySvc - FAILED"
}
else {
$checks["CheckWinHttpAutoProxySvc"].Result = "Passed"
Write-Verbose "CheckWinHttpAutoProxySvc - SUCCESS"
}
}
catch
{
$checks["CheckWinHttpAutoProxySvc"].Result = "Failed"
$checks["CheckWinHttpAutoProxySvc"].Issue = $_
Write-Error "CheckWinHttpAutoProxySvc - FAILED"
Write-Error $_
}

}
#
#Check if iphlpsvc service is running
#
if (!$filterIsPresent -or $Filter -match "CheckIpHlpScv")
{
try
{
$checksExecuted += 1;
$services = Get-Service iphlpsvc
if (($services -eq $null) -or ($services.Status -ne "Running"))
{
$checks["CheckIpHlpScv"].Result = "Failed"
Write-Error "CheckIpHlpScv - FAILED"
Write-Error "These services need to be in running state."
}
else
{
$checks["CheckIpHlpScv"].Result = "Passed"
Write-Verbose "CheckIpHlpScv - SUCCESS"
}
}
catch
{
$checks["CheckIpHlpScv"].Result = "Failed"
$checks["CheckIpHlpScv"].Issue = $_
Write-Error "CheckIpHlpScv - FAILED"
Write-Error $_
}

}

SummaryOfChecks -filterIsPresent $filterIsPresent -checksExecuted $checksExecuted
}
}
Expand Down

0 comments on commit c3a04a1

Please sign in to comment.