When using Active Directory Users and Computers, it is possible to right click on the domain and select "Change Domain Controller".
This gives a list of all DC's and their Status (online/Unavailable)
How can I get that status using powershell?
Have tried:
Get-ADDomainController -identity SERVERNAME
It gives me a lot of information about that DC, but not the status.
Add a calculated property checking the availability via Test-Connection
to the output of Get-ADDomainController
:
Get-ADDomainController |
select *, @{n='Online';e={[bool](Test-Connection $_.IPv4Address 2>$null)}}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.