Powershell/VB Script to list logon server for all computers in a site

Posted on 2011-10-10
Last Modified: 2012-05-12

We have a windows AD Domain (DFL Windows Server 2008) need a way to list all logon servers for workstations (XP, Vista and 7) in a specific site... even if not for a specific site that will be OK.

Question by:datacomsmt
    LVL 11

    Expert Comment

    by:Paul S

    Author Comment

    yes, but how would you configure this to list that for all logged on computers in a site??
    LVL 17

    Expert Comment

    by:Premkumar Yogeswaran
    LVL 39

    Expert Comment

    by:Krzysztof Pytko
    OK, you want to get all Domain Controllers in your environment and check for which Site they authenticate clients, right?

    If so, you can use for that DSQUERY/DSGET or NLTEST commands on your DC or workstation with Administrative Tools installed. Type in command-line

    dsquery server -name * -limit 0 | dsget server -dnsname -site -isgc


    nltest /dclist:<DNS-DOMAIN-NAME>
    nlteste /dclist:testenv.local

    you will get all DCs in your environment and to which site they belong


    Author Comment

    iSiek, no mate, i need to check for currently connected clients and the domain controller they are authenticating to.
    LVL 39

    Accepted Solution

    So, please check if this PS script is a little bit closer to your needs

    If not, then please wait for other PS/VBScript expert


    Author Closing Comment

    no answer
    LVL 2

    Expert Comment

    @ iSiek: I cannot access the link (comes upblank). May I get a copy of that script?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
    Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now