CurrentUser for remote machine under NT
Mark Hammond
MarkH at ActiveState.com
Fri Jun 23 19:33:14 EDT 2000
<kellyk at my-deja.com> wrote in message news:8j0gl2$i9k$1 at nnrp1.deja.com...
> You can try this. It does not always work.
For workstation statistics, you can try this - it _should_ always work (on
NT, anyway!):-)
>>> import win32net, win32api
>>> import pprint
>>> pprint.pprint(win32net.NetWkstaGetInfo(win32api.GetComputerName(),
502))
{'buf_files_deny_write': 0,
'buf_named_pipes': 1,
'buf_read_only_files': 0,
...
To get info on the logged-in user, try:
>>> pprint.pprint(win32net.NetUserGetInfo(None, win32api.GetUserName(),
3))
{'acct_expires': -1,
'auth_flags': 0,
'bad_pw_count': 0,
'code_page': 0,
'comment': u'',
...
Mark.
More information about the Python-list
mailing list