rchiav has asked for the wisdom of the Perl Monks concerning the following question:

Just curious if anyone knows of a module that will enumerate trusted NT domains. ADSI won't. It returns all domains, and in my case, that 431. I belive this includes workgroups too.

I've looked at Win32::NetAdmin, Win32API::Net and Win32::NetResource with no luck. For what I'm working on, at most, the tool will be able to be used on trusted domains. Worst case is that I'll either roll my own, or make the user manually specify a domain.

For refrence, the API calls are here

Thanks,
Rich

Replies are listed 'Best First'.
Re: Enumerating Trusted NT Domains
by physi (Friar) on Jul 31, 2001 at 18:38 UTC
    I'm not sure if this module (Win32::LanMan)can help you, but maybe check it yourselfe. There a things like
    TrustedControllersInformation TrustedDomainAuthInformation TrustedDomainFullInformation TrustedDomainInformationBasic TrustedDomainInformationEx TrustedDomainNameInformation TrustedPasswordInformation TrustedPosixOffsetInformation
    in the Win32::LanMan pod.
    ----------------------------------- --the good, the bad and the physi-- -----------------------------------
      You're correct physi! There is actually a function named NetEnumerateTrustedDomains from Win32::LanMan that should do the trick. From documentation:
      NetEnumerateTrustedDomains($server, \@domains) Enumerates all trusted domain names. The command will be executed on s +erver $server.

      Update: I guess rchiav found this function abut the same time as I did :)
      Thanks.. this actually has the functions I'm looking for.
      LsaEnumerateTrustedDomains($server, \@domains) Enumerates all trusted domains. If you execute this on a workstation o +r a member server, you'll get your domain and the domain sid. If you +execute this on a PDC or BDC, you'll get a list of all trusted domain +s and their sid's.
      Anyone know why this module isn't on CPAN?

      Thanks again..
      Rich