By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,668 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

Users

P: n/a
Do you know of a way to list the users on a Win2K machine? I can't seem
to find a module for this.

Thanks.
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
python1 wrote:
Do you know of a way to list the users on a Win2K machine? I can't seem
to find a module for this.


As a starting point, I played a moment and found this:
import win32net
dir(win32net) ['NetFileClose', 'NetFileEnum', 'NetFileGetInfo', ...
'NetUserEnum', 'NetUserGetGroups', 'NetUserGetInfo', ...] win32net.NetUserEnum() Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: function takes at least 3 arguments (0 given) win32net.NetUserEnum(0, 0, 0) Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: Objects of type 'int' can not be converted to Unicode. win32net.NetUserEnum('', 0, 0)

([{'name': u'Administrator'}, {'name': u'ASPNET'}, {'name': u'Elinor'},
{'name':
u'Guest'}, {'name': u'HelpAssistant'}, {'name': u'Peter'}, {'name':
u'postgres'
}, {'name': u'SUPPORT_388945a0'}], 8, 0)

Searching Google for NetUserEnum would probably be a good
next step. Note that you will need pywin32 (formerly the
win32all) package installed to get win32net.

-Peter
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.