Solved

[Windows NT/2000/XP] Enumerating all domains where user can logon

Posted on 2003-10-30
4
183 Views
Last Modified: 2010-04-05
 Some of you may use Windows 2000, and you may know that, in Windows 2000, when logging in, you must to inform login, password and for some cases, also to inform the domain where you will log in. A pretty Combobox is shown, listing all domains where you can log from that machine.
  My question is: how to discover all domains where you can log from your local machine, to populate that combobox?
  (I discovered the function LSAEnumerateTrustedDomain, but I don't know where can I find the API headers to make it work.)
0
Comment
Question by:knightmad
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Bijith earned 250 total points
ID: 9650431
please
 
look at http://endimus.com/oldcontent/files/index_en.php

Download the file, This contain all you need

cheers
0
 
LVL 3

Expert Comment

by:Bijith
ID: 9650452
In the above link
Sorry to say

DownLoads -->  NetworkUnits

cheers
0
 
LVL 7

Author Comment

by:knightmad
ID: 9655131
Thank you, I am evaluating the answer and will return soon : )
0
 

Expert Comment

by:stewartbash
ID: 21077578
Funny... I have been trying to duplicate what I did in Delphi using c# .NET and I have not gotten what I would expect. The delphi code looks like this:

{you can Ignore the invokation below this was a multi-threaded object in addition you can remove the TDomainObjectClass instanciation of coures... that is my own}

{AND this DOES NOT WORK IIN .NET}

procedure TDomainsObjectClass.GetDomains;
var
  dn: DirectoryEntry;
  en: IEnumerator;
begin
  FStatusDisplay.Panels[1].Text := 'Domain Acquisition In Progress...';
  dn:= DirectoryEntry.Create('WinNT:');
  en := dn.Children.GetEnumerator;
  if en<>nil
    then while en.MoveNext do
           try
             FDomainList.Add( TDomainObjectClass.Create(DirectoryEntry(en.Current).Name.Trim, FComputerDisplay));
             FDomainCount := FDomainList.Count;
           except
           end;
  en := nil;
  dn.Free;
  FDomainDisplay.Invoke(System.Delegate(@FDelegate));
  if FDomainDisplay.Items.Count>0
    then FDomainDisplay.Enabled := True;
end;
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now