Hi,
I find the following script to work with DCDIAG in english environment
function Invoke-DcDiag {
param(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$DomainController
)
$result = dcdiag /s:$DomainController
$result | select-string -pattern '\. (.*) \b(passed|failed)\b test (.*)' | foreach {
$obj = @{
TestName = $_.Matches.Groups[3].Value
TestResult = $_.Matches.Groups[2].Value
Entity = $_.Matches.Groups[1].Value
}
[pscustomobject]$obj
}
}
And the result is :
It works good but I'm in french language and I don't know how to do for it to work.
In english, dcdiag is like this :
In french it's like this :
I know I have to change this line :
select-string -pattern '\. (.*) \b(passed|failed)\b test (.*)'
but I don' tknow exactly what I have to change. (passed, failed, test but not only this)
Merci de marquer comme reponses les interventions qui vous ont ete utile.