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.

Is User Logged into a Domain or a Local Account?

Keywords: 	 login logon domain local account

Question:

What is the BEST way to determine if the current user is logged onto a local account or a domain account?

Answer:

The logon server isn't necessarily the local workstation. It can be a domain controller set up to authenticate logons for the domain - (either a pdc or bdc) that authenticated the account. And if there are multiple controllers, wntUserInfo(3) should identify the particular one.

Verify that the "flags" element of wntUserGetDat gives you what you need. Specifically, checking whether the UF_NORMAL_ACCOUNT or UF_TEMP_DUPLICATE_ACCOUNT bit is set.

Another idea is to use wntUserInfo(1) to get the user's logon domain, and then get the domain that the current machine belongs to (it's in the registry somewhere under HKEY_LOCAL_MACHINE\System\CurrentControlSet), and see if they're the same.


Article ID:   W14267
Filename:   Is User Logged into Domain or Local Account.txt
File Created: 1999:10:26:11:22:56
Last Updated: 1999:10:26:11:22:56