Determine rights and privileges on Windows.

Peter Schmiedeskamp pschmied at yahoo.com
Thu May 27 12:29:17 EDT 2004


Hello, I'm writing a python program (in Windows) from
which I would like to determine whether or not either:
1. The user has administrative access on the current
PC.
or (better)
2. The currently running process has administrative
access.

For the first scenario, the
win32security.LsaEnumerateAccountRight() seems to to
be the ticket.  The documentation doesn't describe
what this function requires as parameters.  It appears
to require a PySID object and some sort of PyHANDLE
object.  I've figured out how to get the PySID object,
but I'm not sure what type of PyHANDLE is required (or
how to create such a thing)

My other alternative is to check the running process
for its authority.  There appear to a number of
functions that sound potentially logical to use,
however I'm unable to determine which I should use.

Has anyone done such a thing?  Many thanks to anyone
who can give me a shove down the right path.

-Peter


	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 




More information about the Python-list mailing list