ive been playing around with this script for finding the "true last logon" from active directory using LDAP to query all the DC. It works really well and i think i get it all
However, i want to use this on some of our old legacy domains, so i assume i have to modify this section to work on WinNT, rather then LDAP? altho i have no idea, so im not sure if its even possible or if im looking at this the correct way? Do legacy domains also have multiple Domain controllers?!
I dont log into the legacy domain, as my RootDSE either
The Legacy domain is called old-xx
Set objRootDSE = GetObject("LDAP://RootDSE"
strConfig = objRootDSE.Get("configurat
strDNSDomain = objRootDSE.Get("defaultNam
' Use ADO to search Active Directory for ObjectClass nTDSDSA.
' This will identify all Domain Controllers.
Set adoCommand = CreateObject("ADODB.Comman
Set adoConnection = CreateObject("ADODB.Connec
adoConnection.Provider = "ADsDSOObject"
adoConnection.Open "Active Directory Provider"
n = adoConnection
strBase = "<LDAP://" & strConfig & ">"
strFilter = "(objectClass=nTDSDSA)"
strAttributes = "AdsPath"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree"
i found this script, however i wasnt sure if this was going to correctly give me a list back of all the different DC on NT4?
Set objNameSpace = GetObject("WinNT://ADE-CH"
For Each Domain In objNameSpace
nb. im writing this in Excel 2003 vb, as i need the results kicked back into an excel file for further analysis