raf wrote:
>
> if you look at the code i supplied, you'll see that that is precisely
> where i get the sid from:
>
>   sid = 
> win32security.ConvertSidToStringSid(win32security.LookupAccountName(None, 
> username)[0])
>
> so win32security.LookupAccountName is not giving me the complete sid for the 
> username.
> any idea why it isn't doing so? any idea what i'm doing wrong?

You are assuming that the user name you got is a local user on this
machine, and never a domain user.  That may be true for the computer
you're using, but it's not safe in the general case.  In my case,
LookupAccountName('timr2-pc', 'timr') produces a very different result
from LookupAccountName('probo','timr').

BTW, I've tried your code on XP and on Win 7 64, and in both cases I get
the full string including the last set of digits.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to