Re: Python win32 tools

2007-03-02 Thread Tim Golden
Sick Monkey wrote:
> I am trying to build a python program that will reset a user's account
> (password) on a windows machine. I have been working with win32
> objects and was wondering if this functionality was already built in.

I'm going to assume that "win32 objects" is the stuff in the
pywin32 extensions. While there isn't a "win32user.ResetPassword"
function in there, you can certainly use the win32com scripting
to automate ActiveDirectory and (trivially) translate this code:

   http://techtasks.com/code/viewbookcode/1592

And just to prove how wrong I can be :) the win32net module
*does* in fact have a function named NetUserChangePassword.
Doc:

"""
win32net.NetUserChangePassword
NetUserChangePassword(server, username, oldPassword, newPassword)

Changes the password for a user.

Comments
A server or domain can be configured to require that a user log on to 
change the password on a user account. If that is the case, you need 
administrator or account operator access to change the password for 
another user acount. If logging on is not required, you can change the 
password for any user account, so long as you know the current password.
"""

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list


Python win32 tools

2007-03-01 Thread Sick Monkey

I am trying to build a python program that will reset a user's account
(password) on a windows machine (NOTE: my intention here is not to implement
anything malicious {and I know about Trinity which is very useful}, but I
just wanted a challenge and do it myself.).  I have been working with win32
objects and was wondering if this functionality was already built in.

Thanks.
-- 
http://mail.python.org/mailman/listinfo/python-list