Solved

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

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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtuailstring tree compare node issue 14 117
Communication Between RC4 Delphi <-> PHP 3 114
Delphi Form ownership 4 89
Find and Replace Stream with 0s 8 62
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 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