EvotecIT / ADEssentials

PowerShell Active Directory helper functions to manage healthy Active Directory
MIT License
429 stars 51 forks source link

Null reference object in Test-DNSNameServers #44

Closed PHactotum closed 4 months ago

PHactotum commented 5 months ago

When running Test-DNSNameServers receive the comment, "Failed to get the zone information for contoso.com on server DC1.contoso.com...."

This appears to be a result of the Jan 2024 commit Convert scriptblock filter to string filter

PS > Get-ADDomainController -Server $domain -Filter "IsReadOnly -eq '$False'"|measure

Count    : 0
Average  :
Sum      :
Maximum  :
Minimum  :
Property :

PS > Get-ADDomainController -Server $domain -Filter {IsReadOnly -eq $false}|measure

Count    : 17
Average  :
Sum      :
Maximum  :
Minimum  :
Property :

I'm not sure how to write this as a string filter that will work. I know the AD cmdlets often cause me to revert to scriptblock filters.

Tested on Windows 10 22H2, with PowerShell 5.1.19041.4291

PrzemyslawKlys commented 5 months ago

It's actually Get-ADDomainController -Server $domain -Filter 'IsReadOnly -eq $false' |ft that works so need to fix it. Thank you for reporting. Maybe you could PR it