Reports the site name for the local computer.
Set objADSysInfo = CreateObject("ADSystemInfo")WScript.Echo "Current site name: " & objADSysInfo.SiteName
This is a VB Script, this can be used by saving the file in .vbs file
One Stop Update for Techies involved with Infrastructure Designing, Consulting, Management and Support
Reports the site name for the local computer.
Set objADSysInfo = CreateObject("ADSystemInfo")WScript.Echo "Current site name: " & objADSysInfo.SiteName
Reports the site name for a specified domain controller (or computer).
strDcName = "atl-dc-01"Set objADSysInfo = CreateObject("ADSystemInfo")strDcSiteName = objADSysInfo.GetDCSiteName(strDcName)WScript.Echo "DC Site Name: " & strDcSiteName
Renames an Active Directory site.
strOldSiteRDN = "cn=Default-First-Site-Name"strNewSiteRDN = "cn=Ga-Atl-Sales"Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSitesContainer = "LDAP://cn=Sites," & strConfigurationNCstrOldSitePath = "LDAP://" & strOldSiteRDN & ",cn=Sites," & strConfigurationNCSet objSitesContainer = GetObject(strSitesContainer)objSitesContainer.MoveHere strOldSitePath, strNewSiteRDN
Lists subnets in a specified Active Directory site
strSiteRDN = "cn=Ga-Atl-Sales"Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSitePath = "LDAP://" & strSiteRDN & ",cn=Sites," & strConfigurationNCSet objSite = GetObject(strSitePath)objSite.GetInfoEx Array("siteObjectBL"), 0arrSiteObjectBL = objSite.GetEx("siteObjectBL")WScript.Echo strSiteRDN & " Subnets" & vbCrLf & _String(Len(strSiteRDN) + 8, "-")For Each strSiteObjectBL In arrSiteObjectBLWScript.Echo Split(Split(strSiteObjectBL, ",")(0), "=")(1)Next
Lists subnets in all Active Directory sites. STDOUT is formatted as a comma-separated values file to accommodate redirecting to a file format compatible with Excel.
Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSubnetsContainer = "LDAP://cn=Subnets,cn=Sites," & strConfigurationNCSet objSubnetsContainer = GetObject(strSubnetsContainer)objSubnetsContainer.Filter = Array("subnet")Set objHash = CreateObject("Scripting.Dictionary")For Each objSubnet In objSubnetsContainerobjSubnet.GetInfoEx Array("siteObject"), 0strSiteObjectDN = objSubnet.Get("siteObject")strSiteObjectName = Split(Split(strSiteObjectDN, ",")(0), "=")(1)If objHash.Exists(strSiteObjectName) ThenobjHash(strSiteObjectName) = objHash(strSiteObjectName) & "," & _Split(objSubnet.Name, "=")(1)ElseobjHash.Add strSiteObjectName, Split(objSubnet.Name, "=")(1)End IfNextFor Each strKey In objHash.KeysWScript.Echo strKey & "," & objHash(strKey)Next
Lists servers in a specified Active Directory site.
strSiteRDN = "cn=Ga-Atl-Sales"Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strServersPath = "LDAP://cn=Servers," & strSiteRDN & ",cn=Sites," & _strConfigurationNCSet objServersContainer = GetObject(strServersPath)For Each objServer In objServersContainerWScript.Echo objServer.NameNext
Lists Active Directory sites.
Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSitesContainer = "LDAP://cn=Sites," & strConfigurationNCSet objSitesContainer = GetObject(strSitesContainer)objSitesContainer.Filter = Array("site")For Each objSite In objSitesContainerWScript.Echo objSite.NameNext
Lists Active Directory connections (nTDSConnection objects) for a specified domain controller.
strDcRDN = "cn=atl-dc-01"strSiteRDN = "cn=Ga-Atl-Sales"Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strNtdsSettingsPath = "LDAP://cn=NTDS Settings," & strDcRDN & _",cn=Servers," & strSiteRDN & ",cn=Sites," & strConfigurationNCSet objNtdsSettings = GetObject(strNtdsSettingsPath)objNtdsSettings.Filter = Array("nTDSConnection")WScript.Echo strDcRDN & " NTDS Connection Objects" & vbCrLf & _String(Len(strDcRDN) + 24, "=")For Each objConnection In objNtdsSettingsWScript.Echo "Name: " & objConnection.NameWScript.Echo "Enabled: " & objConnection.enabledConnectionWScript.Echo "From: " & Split(objConnection.fromServer, ",")(1)WScript.Echo "Options: " & objConnection.OptionsWScript.Echo "Transport: " & Split(objConnection.transportType, ",")(0)WScript.Echo "Naming Contexts"WScript.Echo "---------------"For Each objDNWithBin In objConnection.GetEx("ms-DS-ReplicatesNCReason")Wscript.Echo objDNWithBin.DNStringNextWScript.EchoNext
Reads the bridgeheadTransportList from a domain controller in a site.
On Error Resume NextSet objServer = GetObject _("LDAP://CN=SEA-DC-01,CN=Servers,CN=Default-First-Site-Name," & _" CN=Sites,CN=Configuration,DC=fabrikam,DC=com")dnBHTList = objServer.GetEx("bridgeheadTransportList")WScript.Echo "Bridge Head Transport List:"WScript.Echo "This multi-valued attribute lists the protocol" & _"transports over which this BridgeHead Server replicates"For Each dnValue in dnBHTListWScript.Echo dnValueNext
Deletes an Active Directory subnet.
strSubnetCN = "cn=192.168.1.0/26"Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSubnetsContainer = "LDAP://cn=Subnets,cn=Sites," & strConfigurationNCSet objSubnetsContainer = GetObject(strSubnetsContainer)objSubnetsContainer.Delete "subnet", strSubnetCN
Creates an Active Directory subnet.
strSubnetRDN = "cn=192.168.1.0/26"strSiteObjectRDN = "cn=Ga-Atl-Sales"strDescription = "192.168.1.0/255.255.255.192"strLocation = "USA/GA/Atlanta"Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSiteObjectDN = strSiteObjectRDN & ",cn=Sites," & strConfigurationNCstrSubnetsContainer = "LDAP://cn=Subnets,cn=Sites," & strConfigurationNCSet objSubnetsContainer = GetObject(strSubnetsContainer)Set objSubnet = objSubnetsContainer.Create("subnet", strSubnetRDN)objSubnet.Put "siteObject", strSiteObjectDNobjSubnet.Put "description", strDescriptionobjSubnet.Put "location", strLocationobjSubnet.SetInfo
Creates an Active Directory site link
strSite1Name = "Ga-Atl-Sales"strSite2Name = "Wa-Red-Sales"strSiteLinkRDN = "cn=[" & strSite1Name & "][" & strSite2Name & "]"intCost = 100intReplInterval = 60strDescription = "[" & strSite1Name & "][" & strSite2Name & "]"Const ADS_PROPERTY_UPDATE = 2Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSite1DN = "cn=" & strSite1Name & ",cn=Sites," & strConfigurationNCstrSite2DN = "cn=" & strSite2Name & ",cn=Sites," & strConfigurationNCSet objInterSiteTransports = GetObject("LDAP://" & _"cn=IP,cn=Inter-Site Transports,cn=Sites," & strConfigurationNC)Set objSiteLink = objInterSiteTransports.Create("siteLink", strSiteLinkRDN)objSiteLink.Put "cost", intCostobjSiteLink.Put "replInterval", intReplIntervalobjSiteLink.Put "description", strDescriptionobjSiteLink.PutEx ADS_PROPERTY_UPDATE, "siteList", _Array(strSite1DN, strSite2DN)objSiteLink.SetInfo
Creates an Active Directory site and sets the site link for the new site.
strSiteRDN = "cn=Ga-Atl-Sales"strSiteLinkRDN = "cn=DEFAULTIPSITELINK"strSiteLinkType = "IP" ' Valid values: "IP" or "SMTP"Const ADS_PROPERTY_APPEND = 3Set objRootDSE = GetObject("LDAP://RootDSE")strConfigurationNC = objRootDSE.Get("configurationNamingContext")strSitesContainer = "LDAP://cn=Sites," & strConfigurationNCSet objSitesContainer = GetObject(strSitesContainer)Set objSite = objSitesContainer.Create("site", strSiteRDN)objSite.SetInfoSet objLicensingSiteSettings = objSite.Create("licensingSiteSettings", _"cn=Licensing Site Settings")objLicensingSiteSettings.SetInfoSet objNtdsSiteSettings = objSite.Create("nTDSSiteSettings", _"cn=NTDS Site Settings")objNtdsSiteSettings.SetInfoSet objServersContainer = objSite.Create("serversContainer", "cn=Servers")objServersContainer.SetInfostrSiteLinkPath = "LDAP://" & strSiteLinkRDN & ",cn=" & strSiteLinkType & _",cn=Inter-Site Transports,cn=Sites," & strConfigurationNCSet objSiteLink = GetObject(strSiteLinkPath)objSiteLink.PutEx ADS_PROPERTY_APPEND, "siteList", _Array(objSite.Get("distinguishedName"))objSiteLink.SetInfo
1. Run the Directory Services MPSReports on the problem domain controllers to gather data.
2. Collect information on network hardware (routers, switches, firewalls) that separate partner domain controllers.
3. Verify the following ports are open on any network hardware separating the domain controllers:
389 TCP (LDAP) or TCP 686 if using Secure Sockets Layer (SSL).
389 UDP (LDAP ping).
88 TCP/UDP (Kerberos).
53 TCP/UDP (DNS).
445 TCP/UDP (SMB over IP traffic).
4. Follow the steps listed in KB article 159211 to test for black hole router issues. These may occur when a network router receives a packet larger than the Maximum Transfer Unit (MTU) of the next network segment, and that packet's IP layer "don't fragment" bit is flagged, the router should send an Internet Control Message Protocol (ICMP) destination unreachable message back to the sending host. When this does not happen, packets can be dropped, causing a variety of errors that will vary with the application that is communicating over the failed link.
5. Check for Kerberos fragmentation. To do this, type ping <destination computer> -f -l 1500. Start with 1500 first, working up to 2000. If it fails before 2000, then packets are probably being fragmented. For more information see KB article 244474.
It is important to understand the internal name resolution configuration of the environment. Verify which servers are authoritative for the zone and how the client is configured to retrieve the DNS records. In most cases, the client should only point to DNS servers that can resolve the internal domain name.
1. Verifying proper client configuration
2. Verifying proper DNS server configuration
3. Verifying proper zone delegation
4. Verifying configuration of internal root servers
5. Verifying proper registration of DNS records