Link to home
Start Free TrialLog in
Avatar of crcsupport
crcsupportFlag for United States of America

asked on

Choose Logon server using powershell or another

I'm testing site replication in Active Directory. I have two sites and a link.

1. Is there a way to find logon server in powershell instead of all command 'echo %Logonserver%'?

2. How do I redirect Windows Login of clients to a DC in the remote site? Let's say I have a site A and a site 'Branch'. I like to redirect all user logins at Branch to the Site A without disconnecting the DC?
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of crcsupport

ASKER

Yes, for lab purpose, I wonder if there's a way to force that. It could be fun
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I  created two SRV records for Kerberos and under Default-First-Site-Name,then I gave priority 0 to the logon server which I like to use for all, and change priority of other logon server to 100. Then, I resign in from clients, it still goes to a logon server with priority 100. I tried to flush dns cache, it doesn't help.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I spent a couple of hours to try many methods online, but first of all, as Hulabaloo pointed out, %logonserver% seems a static variable showing last successful logon server, not showing the current logon server. I found this after I spent quite of time testing. So, I think I do  the same tests again when I have time suing 'nltest /sc_query:domainname' . I like to keep this post open for a bit longer for reference purpose.
As I've tested when there are only two sites, I was not able to redirect the logon unless I shut down the local DC. If there are 3 or more sites, then increasing Site LInk costs will do the trick.

Changing the priority SRV record does also only for local site.