Anyone know how the Get-ADUser cmdlet selects a domain controller if the -Server parameter is not specified? I don't want scripts connecting to a DC on the other side of the globe, but I'd rather not specify a DC if I don't need to, since that DC could be decommissioned some day. I could add logic to the scripts to lookup the DCs in the current site, but I don't know if I need to do that. I'm wondering if Get-ADUser automatically selects one in the current AD site, or if it just randomly chooses one like a round robin DNS query for the domain name.
Also, other than monitoring network packets or DC logs, is there an easy way to see which DC the AD cmdlets connect to? I tried -Verbose and -Debug but they didn't seem to do anything.
Thanks