Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
The Get-ADDomainController
cmdlet is a powerful tool in Windows PowerShell that allows administrators to retrieve information about domain controllers in Active Directory. This cmdlet is essential for managing and maintaining the health of an Active Directory environment. It can provide details such as the domain controller's name, site, IP address, and operational status. Understanding how to use this cmdlet can help administrators quickly gather necessary information for troubleshooting and ensuring the smooth operation of their network.
Examples:
Basic Usage: To retrieve information about all domain controllers in the current domain, you can use the following command:
Get-ADDomainController -Filter *
Retrieve Specific Domain Controller: To get information about a specific domain controller by its name, you can use:
Get-ADDomainController -Identity "DC1"
Filter by Site: If you want to find domain controllers in a specific site, you can filter by the site name:
Get-ADDomainController -Filter {Site -eq "Default-First-Site-Name"}
Check Operational Status: To check if a domain controller is operational, you can use:
Get-ADDomainController -Filter * | Select-Object Name, IsGlobalCatalog, IsReadOnly, IsCriticalSystemObject
Retrieve Domain Controller by IP Address: To find a domain controller by its IP address, you can use:
Get-ADDomainController -Discover -Service "LDAP" -Site "Default-First-Site-Name"
Exporting Results: You can export the results to a CSV file for further analysis:
Get-ADDomainController -Filter * | Select-Object Name, Site, IPv4Address | Export-Csv -Path "C:\DCList.csv" -NoTypeInformation