Re: Display All Domain Names on the Network



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....

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
SP4
with Framework 1.1.4322.573. It works fine on XP boxes...

*********************************
Unhandled Exception: System.Management.ManagementException: Invalid class

at

System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus
errorCode)
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
any
way to speed this up?

Thanks again,

Jeff Waskiewicz


.



Relevant Pages

  • Re: Stange program behavious after moving WStation into AD
    ... First question off the top of my head is how does the system detect that files have "landed"? ... Unless you have some new security lockdowns being delivered in GPOs via AD, AD would not impact the local functioning of workstations. ... Joe Richards Microsoft MVP Windows Server Directory Services ...
    (microsoft.public.win2000.active_directory)
  • Re: OT: Update Virus Checker
    ... > The first question is: "Are you safer from virus attacks with OS ... Microsoft (along with Windows users) is in a sense a victim ... > to many of the security problems associated with those products. ...
    (rec.outdoors.fishing.fly)
  • Re: Limitation to combobox items
    ... To answer your first question. ... Working with Windows Forms for Database front ends does seem a little rough ... > I stop trying to make them work and start shopping for a third party suite ... > of controls? ...
    (microsoft.public.dotnet.framework.windowsforms.databinding)
  • Re: IE Options-Programs
    ... >> For the first question, make sure OE is your default e-mail client. ... >> And please see these articles about virus protection in OE 6: ... >> Description of how the Attachment Manager works in Windows XP Service ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)