Finding the domain controller that authenticated you

A question on my blog asked how do you know which domain controller you are running against when you search Active Directory. Unless you explicitly instruct your script to use a specific domain controller it will use the one to which you authenticated.

You can find the DC to which you authenticated with this simple function

function get-logonserver{
$env:LOGONSERVER -replace "\\", ""
}

Published Fri, Jan 4 2013 17:59 by RichardSiddaway

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: