Você pode usar o PowerShell Get-TroubleshootingPackdletlet para orientá-lo no processo de criação de um arquivo de resposta para uso posterior com Invoke-TroubleshootingPack Cmdlet para automatizar.
Steps: Creating and Running Manually
1. PowerShell (create answer file)
$aFile = "C:\Folder\Path\AudioAnswerFile.xml"
Get-TroubleshootingPack -Path "C:\Windows\diagnostics\system\Networking" -AnswerFile $aFile
Options to pick during answer file creation
Important: I only picked what I think I needed to pick but do further testing and put more time and thought into each answer just in
case you see something applicable in your case.
Answer File Content
Note: *Now that you have an answer file, you can use it to point to jobs that you can automate or create shortcuts to run as a batch as
I'll talk about with more detail below.
<?xml version="1.0" encoding="UTF-8"?>
<Answers Version="1.0">
<Interaction ID="IT_EntryPoint">
<Value>HTTP</Value>
</Interaction>
<Interaction ID="IT_WebChoice">
<Value>Internet</Value>
</Interaction>
<Interaction ID="IT_Protocol">
<Value>6</Value>
</Interaction>
<Interaction ID="IT_DefaultConnectivityInitialChoice">
<Value>HTTPorUNC</Value>
</Interaction>
</Answers>
2. PowerShell (run diagnostic process)
Note: The $aFile
variable value should point to the answer file you just created in #1 above. The $dFolder
variable value should be
a folder to check for the results of the diagnostic after it runs.
$aFile = "C:\Folder\Path\AudioAnswerFile.xml"
$dFolder = "C:\Folder\Path\Diag"
$var = Get-TroubleshootingPack -Path "C:\Windows\diagnostics\system\Networking"
Invoke-TroubleshootingPack -Pack $v -AnswerFile $aFile -Unattended -Result $dFolder
Results
Now open up the result files from this command you invoked with the
answer file by going to the folder specified in the $dFolder
variable value and you'll have some files you can further analyze.
Result Folder Files
675B09EE-5DE8-4AF5-B10D-07DB894902D2.Diagnose.0.etl
DebugReport.xml
NetworkConfiguration.cab
ResultReport.xml
results.xsl
Coloquetudoemumarquivodelote
Observação:Espera-sequeoarquivoderespostajáestejaconfiguradoeemumlocallegívelparaocmdletInvoke-TroubleshootingPack
utilizar,entãoéissoquevocêcriacomaetapa1acima.Alémdisso,vocêsóprecisadefinirosvaloresAnswerFile=
eDiagFolder=
paraseremlocaisválidosparaosquaisvocêpodegravar.
@ECHOOFFSET"AnswerFile=C:\Folder\Path\AudioAnswerFile.xml"
SET "DiagFolder=C:\Folder\Path\Diag"
CALL :PowerShell
CD /D "%PowerShellDir%"
Powershell -ExecutionPolicy Bypass -Command "& '%PSScript%'"
:PowerShell
SET PowerShellDir=C:\Windows\System32\WindowsPowerShell\v1.0
SET PSScript=%temp%\~tmpNtwkDiagTrblsht.ps1
IF EXIST "%PSScript%" DEL /Q /F "%PSScript%"
ECHO $aFile = "%AnswerFile%">"%PSScript%"
ECHO $dFolder = "%DiagFolder%">>"%PSScript%"
ECHO $var = Get-TroubleshootingPack -Path "C:\Windows\diagnostics\system\Networking">>"%PSScript%"
ECHO Invoke-TroubleshootingPack -Pack $var -AnswerFile $aFile -Unattended -Result $dFolder>>"%PSScript%"
GOTO :EOF
Executar validação adicional
Depois que esse processo é executado, você deve ver no Visualizador de eventos do Windows do Log do sistema e ID do evento 4100
no "Diagostics - "fonte" com uma mensagem "Nível de informação" indicando
"The Network Diagnostics Framework has completed the diagnosis phase
of operation, but no network problem was identified."
Maisrecursos