Solved

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

Posted on 2003-10-30
4
186 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

808 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