EvotecIT / Testimo

Testimo is a PowerShell module for running health checks for Active Directory against a bunch of different tests
MIT License
534 stars 56 forks source link

Modify Windows Roles and Feature for other language os #79

Closed Fiyorden closed 4 years ago

Fiyorden commented 4 years ago

To make it work on non-English speaking windows server

PrzemyslawKlys commented 4 years ago

Looks good. On a side note, does DCDiagnostics source works fine on non-english system?

Fiyorden commented 4 years ago

Only with repadmin on file ReplicationStatus.ps1

PrzemyslawKlys commented 4 years ago

what about this one: Test-ADDomainController -ComputerName $DomainController -WarningAction SilentlyContinue

Fiyorden commented 4 years ago

Hello no message C:\Users\administrateur.XXXX> Test-ADDomainController -ComputerName localhost -WarningAction SilentlyContinue C:\Users\administrateur.XXX> Test-ADDomainController -ComputerName localhost

PrzemyslawKlys commented 4 years ago

ok, that means dcdiag output must be different in non-english systems.

PrzemyslawKlys commented 4 years ago
function Test-ADDomainController {
    [CmdletBinding()]
    param([string[]] $ComputerName,
        [Parameter(Mandatory = $false)][PSCredential] $Credential = $null)
    $CredentialParameter = @{ }
    if ($null -ne $Credential) { $CredentialParameter['Credential'] = $Credential }
    $Output = foreach ($Computer in $ComputerName) {
        $Result = Invoke-Command -ComputerName $Computer -ScriptBlock { dcdiag.exe /v /c /Skip:OutboundSecureChannels } @CredentialParameter
        for ($Line = 0; $Line -lt $Result.length; $Line++) {
            if ($Result[$Line] -match '^\s{9}.{25} (\S+) (\S+) test$') { $Result[$Line] = $Result[$Line] + ' ' + $Result[$Line + 2].Trim() }
            if ($Result[$Line] -match '^\s{6}Starting test: \S+$') { $LineStart = $Line }
            if ($Result[$Line] -match '^\s{9}.{25} (\S+) (\S+) test (\S+)$') {
                $DiagnosticResult = [PSCustomObject] @{ComputerName = $Computer
                    Target                                          = $Matches[1]
                    Test                                            = $Matches[3]
                    Result                                          = $Matches[2] -eq 'passed'
                    Data                                            = $Result[$LineStart..$Line] -join [System.Environment]::NewLine
                }
                $DiagnosticResult
            }
        }
    }
    $Output
}

The command is really simple and works with english. Would it be possible for you to run this:

dcdiag.exe /v /c /Skip:OutboundSecureChannels

and provide output in a text file? Of course with replaced details for computer name/domain