Microsoft Operations Manager |
The NextDomainControllermethod gets the next domain controller in the list of domain controllers in the forest.
[VBScript]
ActiveDirectory.NextDomainController()
None
String
The following example shows how to enumerate the domain controllers in the forest and return their names in an array.
[VBScript]
Function GetDCs()
Dim objActiveDirectory
Dim strDomainController
Dim arrDCs()
Dim intIndex
intIndex = 0
Set objActiveDirectory =
CreateObject("McActiveDir.ActiveDirectory")
If (objActiveDirectory.RefreshDomainControllers()) Then
strDomainController =
objActiveDirectory.NextDomainController()
While NOT(strDomainController = "")
ReDim Preserve arrDCs(intIndex)
arrDCs(intIndex) = strDomainController
intIndex = intIndex + 1
strDomainController =
objActiveDirectory.NextDomainController()
Wend
End If
Set objActiveDirectory = Nothing
GetDCs = arrDCs
End Function
Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1
Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.