Group29.com - What did you expect?
  Create an account
:: Home  ::  Downloads  ::  Your Account  ::  Forums  ::
Google Adsense
Modules
  • Home
  • Downloads
  • ExpectationReviews
  • Forums
  • Group29 FAQ
  • MovieReviews
  • OtherReviews
  • Stories Archive
  • Submit News
  • Top 10
  • Topics
  • Web Links
  • New at Group29
    ·2017 USC vs UCLA preview
    ·Movie Review: IT (2017) [25]
    ·Movie Review: Dean [20]
    ·Forum Topic: Update your Facebook property
    ·2016 UCLA vs USC preview
    ·Expectation Review: Star Wars: The Force Awakens [29]
    ·Web Link: WEP Key Converter
    ·Expectation Review: Jupiter Ascending [25]
    ·Forum Topic: Why does my IPA file get saved as a zip file in IE?
    ·Web Link: BeyondCompare

    read more...
    TheForce.Net
    ·Rebelscum Breast Cancer Awareness Charity Patch
    ·BBC Interviews J.J. Abrams About Trek And Wars
    ·CEII: Jabba's Palace Reunion - Massive Guest Announcements
    ·Fathead's May the Fourth Be With You!
    ·Star Wars Night With The Tampa Bay Storm Reminder
    ·Stephen Hayford Star Wars Weekends Exclusive Art
    ·ForceCast #251: To Spoil or Not to Spoil
    ·New Timothy Zahn Audio Books Coming
    ·SDCC: Exclusive Black Series Boba Fett With Han In Carbonite Set
    ·Star Wars Art Exposition May 4th

    read more...
    Hot trends
    ·Group29.com

    read more...
    Group29 Discussion Board :: View topic - How do find the name of my Primary Domain Controller (PDC)?
    Log in Register Forum FAQ Memberlist Search
    Ratings, Links, Free Speech and more

    Group29 Discussion Board Forum Index -> Group29 Tech Tips -> How do find the name of my Primary Domain Controller (PDC)?
    Post new topic  Reply to topic View previous topic :: View next topic 
    How do find the name of my Primary Domain Controller (PDC)?
    PostPosted: Tue Sep 25, 2007 11:27 am Reply with quote
    BB
    Regular
     
    Joined: Jun 23, 2004
    Posts: 340


      


    How do I find the name of my Primary Domain Controller in the PDC, and how do I find out which domain controller I logged into? The answer is in VBScript.

    Copy the following code into notepad and save it as a file called "findDC.vbs"

    Code:
    REM if the clients are W2k or above, the ADSystemInfo object has SiteName and
    REM GetAnyDCName. If the offices are each in a defined site, then SiteName would
    REM be good. I can't find documentation on GetAnyDCName, but I think it will be
    REM the DC that responds first. It will be the DNS name in the form similar to
    REM MyServer.MyDomain.com.

    Set objSysInfo = CreateObject("ADSystemInfo")
    Wscript.Echo "ADSystemInfo.SiteName.:" & objSysInfo.SiteName
    Wscript.Echo "ADSystemInfo.SiteName.GetAnyDCName:" & objSysInfo.GetAnyDCName

    REM If the client is NT or above, you can retrieve the environment variable
    REM %LOGONSERVER%, in the form \\MyServer:

    Set objShell = CreateObject("Wscript.Shell")
    Wscript.Echo "Wscript.Shell.Environment.Process.LogonServer:" &  objShell.Environment("Process").Item("LogonServer" )

    REM Finally, on any client (Windows 95 or above, with DSClient), the RootDSE
    REM object can retrieve ServerName:

    Set objRootDSE = GetObject("LDAP://RootDSE")
    Wscript.Echo "LDAP://RootDSE . ServerName:" & objRootDSE.ServerName

    REM The last will be similar to
    REM "cn=MyServer,cn=servers,cn=MySite,cn=sites,cn=conf iguration,dc=MyDomain,dc=c
    REM om", so you have to parse it for the DC name.

    REM There is also WinNTSystemInfo.PDC, but it seems to only be available on W2k
    REM and above:

    Set objNTInfo = CreateObject("WinNTSystemInfo")
    Wscript.Echo "WinNTSystemInfo.PDC:" & objNTInfo.PDC



    Save the code and open a command prompt in the directory where you saved the file. If you saved it in C:\My Documents, do Start Menu -- run -- cmd. Then cd \"My Documents"

    At the command prompt, type

    Code:
    cscript findDC.vbs


    The output will look like this

    Quote:
    ADSystemInfo.SiteName.:YourSite
    ADSystemInfo.SiteName.GetAnyDCName:YourBDC.tree.domain
    Wscript.Shell.Environment.Process.LogonServer:\\YourBDC
    LDAP://RootDSE . ServerName:CN=YourBDC,CN=Servers,CN=YourSite,CN=Sites,
    nfiguration,DC=ds,DC=uhc,DC=com
    WinNTSystemInfo.PDC:YourPDC
    View user's profile Visit poster's website
    Bumped to the main page
    PostPosted: Fri Jun 20, 2008 8:30 am Reply with quote
    BB
    Regular
     
    Joined: Jun 23, 2004
    Posts: 340


      


    How to find the name of the Primary Domain controller

    http://www.group29.com/modules.php?name=News&file=article&sid=185
    View user's profile Visit poster's website
    How do find the name of my Primary Domain Controller (PDC)?
      Group29 Discussion Board Forum Index -> Group29 Tech Tips
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum
    All times are GMT - 6 Hours  
    Page 1 of 1  

      
      
     Post new topic  Reply to topic  


    Powered by phpBB © 2001-2003 phpBB Group
    Theme created by Vjacheslav Trushkin
    Forums ©
    Group29 Productions

    All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest (c) 2006 by Group29 Productions.


    You can syndicate Group29 Productions news with an RSS Feeder using the file backend.php


    PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
    Page Generation: 0.19 Seconds

    :: HeliusGray phpbb2 style by CyberAlien :: PHP-Nuke theme by www.nukemods.com ::