I'm trying to get the number (count) of domain controllers in the domain. See below example code:
Import-Module ActiveDirectory -Force
(Get-ADDomainController -Filter "*" | Select-Object Name).Count
2
However when running the command in a domain with a single domain controller (count 1) there is no output.
(Get-ADDomainController -Filter "*" | Select-Object Name).Count
No output. Why is the 'Count' not shown as 1 with a single DC? What am I missing?