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

DNS Tests fail - No Data Available #78

Closed ERAustin closed 4 years ago

ERAustin commented 4 years ago

All DNS tests fail with no data provided. Reinstallation of PSWinDocumentation.DNS doesn't help. Seems like some cmdlets are not loaded - for example "Get-WinDnsServerForwarder" is not a recognized cmdlet. Tried on multiple servers and domain controllers

Testimo_DNS

PrzemyslawKlys commented 4 years ago

The usage is:

$Domain = 'YOURDOMAIN'
$PSWinDocumentationDNS = Import-Module PSWinDocumentation.DNS -PassThru

& $PSWinDocumentationDNS {
    param($Domain)
    $Forwarders = Get-WinDnsServerForwarder -Domain $Domain -WarningAction SilentlyContinue
    Compare-MultipleObjects -Objects $Forwarders -FormatOutput -CompareSorted:$true -ExcludeProperty GatheredFrom -SkipProperties -Property 'IpAddress' #| Out-HtmlView -ScrollX -DisablePaging  -Filtering
} $Domain

Try this. Since that command is not public it doesn't work without all the added code as above. Let me know what is the result.

ERAustin commented 4 years ago

In testing I did add the domain with no success. Output from your code above is below:

Get-ADDomainController : Directory object not found At C:\Program Files\WindowsPowerShell\Modules\PSWinDocumentation.DNS\0.0.8\PSWinDocumentation.DNS.psm1:165 char:61

PrzemyslawKlys commented 4 years ago

Did you change YourDomain to your domain name?

Get-ADDomainController -Filter * -Server 'yourdomainworks'
Get-ADDomainController -Filter * -Server $ENV:USERDNSDOMAIN

does either of those works?

ERAustin commented 4 years ago

Yes, I did change the domain name. For some reason, both of those commands you asked about result in "Directory Object not found"

Interestingly enough, if I simply query "Get-ADDomainController" that returns my PDC.

However if I qualify that with "-Filter *" or anything else then I get "Directory Object not found"

PrzemyslawKlys commented 4 years ago

That's weird. Get-ADDomainController -Filter * delivers all DC's within a domain. Make sure you have updated PS to 5.1 version and maybe up to date RSAT?

PrzemyslawKlys commented 4 years ago

Make sure it's 5.1.


$PSVersionTable                                                                                                                                                                                                                                                                                                                                

Name                           Value
----                           -----
PSVersion                      5.1.18362.145
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.145
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
ERAustin commented 4 years ago

I will look into updating RSAT. PSVersion looks good.

Y:> $psversiontable

Name Value


PSVersion 5.1.14393.3053
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.3053
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

ERAustin commented 4 years ago

I uninstalled all the AD DS and AD LDS Tools from Programs and Features, rebooted, then reinstalled them. The issue still remains.

PrzemyslawKlys commented 4 years ago

Well, it's not really a problem with testimo since it's about Get-ADDomainController -Filter * not delivering results at all. That command is pretty basic and critical for Testimo operations. Do other tests work fine?

ERAustin commented 4 years ago

Yes, all of the other tests are great. Since this appears to be a local issue and not related to Testimo then we can likely close this issue. I thank you for your help.

PrzemyslawKlys commented 4 years ago

Just so you know, it's extremely weird that command doesn't work. Maybe your domain is broken or something and that causes a problem with that command. Try running it on DC's or different machines or maybe review event logs.

ERAustin commented 4 years ago

Just to follow up, I've corrected this issue. The reason for this was that there were some RIverbed devices that were showing up in Sites and Services. They should not have been there and were presenting as RoDCs and causing the lookup to fail. After deleting them, the query worked as expected.

Fix: https://translate.google.com/translate?hl=en&sl=auto&tl=en&u=https%3A%2F%2Fwww.linkedin.com%2Fpulse%2Fget-addomaincontroller-filter-directory-object-found-%25C3%25A7%25C3%25B6z%25C3%25BCm%25C3%25BC-aladag

PrzemyslawKlys commented 4 years ago

Great! Thank you for your follow up!