[python-win32] Re: Using LogonUser with Guest account
rwupole at msn.com
Tue Mar 25 00:23:58 CET 2008
Giampaolo Rodola wrote:
> I'm trying to write a plug-in for a ftp server of mine to permit the
> integration with accounts defined on the Windows system.
> What I basically need is impersonating a user, execute e filesystem
> call (e.g. create a directory via os.mkdir()) and then switch back to
> the original user (Administrator).
> I wrote down this simple class which seems to fit pretty well for my
> class WinNTAuthorizer:
> def impersonate_user(self, username, password):
> self.impersonated_user_handler = win32security.LogonUser(
> def terminate_impersonation(self):
> What I need now is impersonating the Guest user to handle the
> anonymous logins (which it's exactly what IIS FTPd does) but I don't
> know how to do it.
> Does Guest account has a password or do I have to use something
> different than LogonUser to manage it?
> Could someone point me in the right direction?
> Thanks in advance.
I think you're looking for win32security.ImpersonateAnonymousToken.
Note that Anonymous is not the same thing as the Guest account.
More information about the python-win32