WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Get Domain User Info


Question:

I am trying to get a user info for a domain ID (i.e. user's full name, priviledge level and so on) but can not find a function that would return this kind of info for a domain user. Something similar to wntUserProps, but for domain ruther then machine account.

Answer:

Please be a little more specific. There's different types of information, and a few different wnt*() functions in the NT extender to retrieve the information. Also, the information varies in some cases depending on which computer you ask for the information to be retrieved from.

Use wntUserGetDat() to retrieve account information. If you supply the name of a DC for the server-name parameter, then you will be getting information for a domain account. If the server-name is a workstation or member server then you'll be getting information about local accounts. This is the preferred method to use when getting account information for domain accounts via the legacy NT domain interfaces. Use the ADSI extender to access the attributes that are specific to AD user objects when running in an AD environment.

Use wntPrivGet() & wntPrivList() to retrieve information about privileges. Please note that privs are assigned on a per-system basis, so there's no way to query a single DC to find out what privs a domain account has assigned on various computers in a domain. Instead, you must query eacy computer and ask what privs any given domain account has been granted on the computer.

The privilege levels reported by wntUserProps() Req #7 are, shall we say, somewhat vague & nebulous. This is exactly what is being returned by a Win32 API function, but they seem to most closely relate to basic group memberships, such as being in the "Users" or "Domain Users" groups, or the "Administrators" or "Domain Admins" groups. The function wntUserProps() can't report on privs that a user may have via membership in other groups that in turn have been granted specific privs on a specific computer in a domain.

You should be able to call wntUserProps() and simpl specify a DC as the server-name parameter in order to use it to get information about domain user accounts.


Article ID:   W17059
File Created: 2007:07:03:14:28:02
Last Updated: 2007:07:03:14:28:02