Kurulum, keşfedilen tüm DNS Sunucularına yönelik DNSSEC doğrulamaları için yapılandırılmışsa DNSSEC ayarını doğrulayın. Görevin yürütülmesi için en az bir Windows 2016 ve 1709+ DNS Sunucusu gereklidir.
$file = New-Item -Path $filePath -ItemType "file" -ErrorAction:Stop
Add-Content -Path $filePath -Value $html -ErrorAction:Stop
Write-Host "Report path: " $filePath
}
catch
{
Write-Host "Report writing failed, .html report will not be written to output folder. You can find it below."
Write-Host
Write-Host $resultHtml
}
}
else
{
Write-Host "Output folder is invalid. Html report will not be written to output folder"
}
}
# very dirty trick - remove in next version by passing timeout into script
if ($taskName -eq 'Microsoft.Windows.DNSServer.2016.Task.HealthCheck.ConfiguredRootHints')
{
$calcTimeout = $targets.Count * 1000
$overrides.Add("TimeoutSeconds",$calcTimeout.ToString())
}
else
{
$calcTimeout = 250
}
if($OutputFolder -eq $null -or $OutputFolder -eq "")
{
# here we do not remove linebreaks
$xml = [xml]($taskResult.Output)
if($xml.DataItem.StdOut.InnerText -ne $null)
{
$str = $xml.DataItem.StdOut.InnerText
$str = $str.Replace("&amp;lt;","<")
$str = $str.Replace("&amp;gt;",">")
$str = $str.Replace("&lt;","<")
$str = $str.Replace("&gt;",">")
$resultHtml = $str
}
else
{
Write-Host "There are no Task Output"
}
#Write-Host "OutputFolder parameter is not specified, task report will not be written."
Write-Host $resultHtml
}
else
{
$xml = [xml]($taskResult.Output)
if($xml.DataItem.StdOut.InnerText -ne $null)
{
$str = $xml.DataItem.StdOut.InnerText
$str = $str.Replace("`n","");
$str = $str.Replace("`r","");
$str = $str.Replace("&amp;lt;","<")
$str = $str.Replace("&amp;gt;",">")
$str = $str.Replace("&lt;","<")
$str = $str.Replace("&gt;",">")
$resultHtml = $str
}
else
{
Write-Host "There are no Task Output"
}
Write-Host "OutputFolder: " $OutputFolder
try
{
Save-TaskHtmlReport -path $OutputFolder -reportName $ReportName -html $resultHtml
}
catch
{
Write-Host "Report writing failed, .html report will not be written to output folder. You can find it below."
Write-Host
Write-Host $resultHtml
}
}
}
else
{
if($taskResult.Status -eq [Microsoft.EnterpriseManagement.Runtime.TaskStatus]::Started)
{
Write-Host "Remote task was timed out. Report will not be written to output folder."
}
else
{
$res = $taskResult.Status
Write-Host "Remote task failed with status " $res
}
}
}
else
{
Write-Host 'No objects to perform complex tasks. Computer with DNS Server role required.'
}
$SCOMPowerShellKey = "HKLM:\SOFTWARE\Microsoft\System Center Operations Manager\12\Setup\Powershell\V2"
$SCOMModulePath = (Get-ItemProperty $SCOMPowerShellKey).InstallDirectory
if ($true -eq [string]::IsNullOrEmpty($SCOMModulePath))
{
$ErrorMessage = "Path to SCOM cmdlets not found in registry."
Write-Host $ErrorMessage
exit
}