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.

wntCurrUsers and How it Reports Running Services

Keywords: 	  wntCurrUsers	  Services

Question:

We're using the following as part of a program (99F release):
        a = wntCurrUsers ( node , 0 )
        n = ItemCount ( a , @TAB )
        message ( a , n )
running this against a server who has serveral services installed NOT running them with the default user SYSTEM but a real user e.g. ROOT/ADMIN ... reports each service as a logged in user e.g. I get 6 times ADMIN. some hints - known as a small bug - ...

Answer:

I talked to the developers of this function, and they say that this is its expected behavior.

MORE...Question:

It seems that the function wntCurrUsers(server_name, flags) is returning more users than are actually connected.

My syntax is

 wntCurrUsers ('\\Srvr166', 0 )
Specifically it is showing duplicates of the user even though they have logged out. I am using the most current version of the wwwnt34I.dll extender.

The benchmark of actual current users I am comparing against is the Microsoft command (run at a command line):QUERY USER
The microsoft command seems to accurately show the current users.

I am using Win2000 server and am running the script on the server itself. It is a 2 computer network Therefore it is only one server in the domain. The workstation is Win98.

MORE...Answer:

Apparently there is a problem with the Windows API, that wntCurrUsers uses. It seems there is a bug in either userenv.dll or lsasrv.dll where a user's NT token is not closed when they logout. The result , the one we noticed anyway, is that sometimes calls to NetWkstaUserEnum, and possibly any other calls in that family, will result in bogus information. That call is supposed to return the name of the currently logged in user. What you get is a list of every non-admin user who has logged in since the last reboot.

"User Logout Bug"

http://ntbugtraq.ntadvice.com/default.asp?pid=36&sid=1&A1=ind9811&L=ntbugtraq#40


Article ID:   W14268
Filename:   wntCurrUsers Behavior.txt
File Created: 2001:03:01:14:18:52
Last Updated: 2001:03:01:14:18:52