Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NetServerEnum / NetUserEnum not quite good enough

136 views
Skip to first unread message

John Kane

unread,
Jul 2, 1999, 3:00:00 AM7/2/99
to
Greets all,

I have a commonly asked problem, but with a little twist.

I am trying to return the list of domains just like the list a user sees
in their drop down box during an NT login. I don't want to retrieve all
of the domains you'd see if you went through Network
Neighborhood/Microsoft Networking. I guess the difference between the
two is that the drop down list is the list of domains that trust you
(TRUSTING) while the other is the ones you trust (TRUSTED).

I have tried using NetServerEnum with SV_TYPE_DOMAIN_ENUM and that
returns the latter (in my case about 40). I have tried using
NetUserEnum with FILTER_INTERDOMAIN_TRUST_ACCOUNT which returns about 17
in my case. What I want is the 7 (my case) TRUSTING domains just like
the NT login drop down.

Speed is also a consideration so I don't know how much flexibility I
have to kludge/prune the list down by getting the PDC and seeing if my
domain is TRUSTED.

Am I using these functions wrong or do I want something else entirely
like with LSA functions that've been mentioned in my Deja search on this
topic? Perhaps there are other flags to the NetEnum functions that
would help?

I appreciate any responses.

Thanks,
--
>------------<
John Kane
so...@minn.net
>------------<

Felix Kasza [MVP]

unread,
Jul 2, 1999, 3:00:00 AM7/2/99
to
John,

> I am trying to return the list of domains just like the list a user sees
> in their drop down box during an NT login.

You may want to look up NetEnumerateTrustedDomains(). Since I had, um,
mixed results with NETD(), I invite you to check the warning at
http://mvps.org/win32/network/netd.html first.

--

Cheers,

Felix.

If you post a reply, kindly refrain from emailing it, too.
Note to spammers: fel...@mvps.org is my real email address.
No anti-spam address here. Just one comment: IN YOUR FACE!

Guoyong Zhang

unread,
Jul 2, 1999, 3:00:00 AM7/2/99
to
Hi, John,

Use LSA to enumerate trusted domains just like the NT login drop down.

Microsoft has an example doing exactly what you want.
The url for that is:
http://msdn.microsoft.com/library/devprods/vs6/vc++/vcsample/vcsmpdisptrussa
mple.htm

Regards,
Guoyong

Andy Doran

unread,
Jul 3, 1999, 3:00:00 AM7/3/99
to
...which apart from not being there anymore is in C++ not VB...

Guoyong Zhang <zh...@bluestone.com> wrote in message
news:ObVWL4Lx#GA.243@cppssbbsa03...

PixelCat

unread,
Jul 3, 1999, 3:00:00 AM7/3/99
to

Andy Doran <andy....@dial.pipex.com> wrote in message
news:7lkkc9$pii$1...@lure.pipex.net...

> ...which apart from not being there anymore is in C++ not VB...

Actually, yes it its--the URL wrapped.

Aaron J Margosis

unread,
Jul 4, 1999, 3:00:00 AM7/4/99
to
Actually, I think the dialog's dropdown *is* populated by
NetEnumerateTrustedDomains. At least, that's what it looks like to me based on
running "dumpbin /imports" on MSGINA.DLL, extracting strings (ANSI and Unicode),
etc.

Guoyong Zhang wrote:

> Hi, John,
>
> Use LSA to enumerate trusted domains just like the NT login drop down.
>
> Microsoft has an example doing exactly what you want.
> The url for that is:
> http://msdn.microsoft.com/library/devprods/vs6/vc++/vcsample/vcsmpdisptrussa
> mple.htm
>
> Regards,
> Guoyong

-- Aaron [MVP]
---------------------
Aaron J Margosis
aaro...@erols.com

Ben Hutchings

unread,
Jul 5, 1999, 3:00:00 AM7/5/99
to
[Followups set]

Andy Doran (andy....@dial.pipex.com) wrote:
: ...which apart from not being there anymore is in C++ not VB...
<snip>

Check the Newsgroups header. You'll find microsoft.public.vc.language
on the end of the long (*far* too long) list. Some people don't seem
to understand the idea of selecting the *most* appropriate newsgroup
rather than all that seem appropriate. This is the spammer mentality.

Ben.

--
Any opinions expressed are my own and not necessarily those of Laser-Scan.

0 new messages