Re: Display All Domain Names on the Network
- From: "Peter Proost" <pproost@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 27 Apr 2006 08:18:08 +0200
Hi to answer your first question, I just checked it (using wbemtest and
connect to root\cimv2) the Win32_NTDomain class doesn't exist on windows
2000, so that should explain your error. I'll see if I can find a win2000
sample
With the second question I can't help you.
Greetz Peter
--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning. (Rich Cook)
"Jeff Waskiewicz" <JeffWaskiewicz@xxxxxxxxxxxxxxxxxxxxxxxxx> schreef in
bericht news:36D6E9E8-FC8D-4E6A-977B-501B6B675D84@xxxxxxxxxxxxxxxx
Thanks, that got me going however I created 2 questions....SP4
First here is a simple console app sample...
*********************************
Imports System
Imports System.Management
Module Module1
Sub Main()
Dim objSearcher As New ManagementObjectSearcher("SELECT * FROM
Win32_NTDomain")
Dim objDomain As ManagementObject
For Each objDomain In objSearcher.Get()
Console.WriteLine("Domain = " & objDomain("Name").ToString())
Next objDomain
Do Until LCase(Console.ReadLine()) = "exit"
Loop
End Sub
End Module
*********************************
For the most part this gets me what I need a list of all available domains
however while testing it I ran into 2 issues:
1) I get the following exception when running the code on a Windows 2000
with Framework 1.1.4322.573. It works fine on XP boxes...System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus
*********************************
Unhandled Exception: System.Management.ManagementException: Invalid class
at
errorCode)any
at System.Management.ManagementObjectEnumerator.MoveNext()
at DomianNames.Module1.Main()
*********************************
I have looked at just about everything I can think of and I am at a loss.
2) The objSearcher.Get() is very slow. The network I am working on has 25
domains in the forest. It takes about 1.5 minutes to execute. Is there
way to speed this up?
Thanks again,
Jeff Waskiewicz
.
- References:
- Display All Domain Names on the Network
- From: Jeff Waskiewicz
- Re: Display All Domain Names on the Network
- From: Stuart Nathan
- Display All Domain Names on the Network
- Prev by Date: Re: Do loop memory consumption?
- Next by Date: Re: minimizing viewstate
- Previous by thread: Re: Display All Domain Names on the Network
- Next by thread: Classes and collections vs. virtual tables (datasets)
- Index(es):
Relevant Pages
|
|