Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check remote PCs to see which domain controllers they use for authentication

Status
Not open for further replies.
Jul 31, 2017
1
US
I am new to scripting and I was given a task to write a PowerShell script to check for what domain controllers all PCs in our enterprise are using for authentication and have the data exported to a file. With some help, I have a script below and I would like to know your feedback on whether this script will accomplish what I am tasked with.

Get-ADDomainController -Filter * | Select-Object -Property Name -searchbase "OU=yourcomputerOU,DC=domain,DC=com" | %{(Get-WmiObject -Class win32_ntdomain -Filter "DomainName = 'mydomain'" -ComputerName $_.Name).DomainControllerName}


Thanks,
Kano
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top