On 17/02/2012 18:26, Rod Person wrote:
Hi,

I'm trying to get a list of User Groups that have access to shares on a
remote server. I am able to get a listing of all the shares on the
server using wmi. This is the cloesest I got so far:

import win32security as win32s

sd = win32s.GetFileSecurity(sh,win32security.GROUP_SECURITY_INFORMATION)

Assuming that "sh" here is the name of of the share
(eg \\server\share1) then be aware that the result
of GetFileSecurity is the security on the underlying
folder, not the security of the share itself.

Now, share-level security is, I think, relatively unusual
and you might well want to know the file security as well,
but they're not the same thing. (Just in case).

Another caveat: you almost certainly don't want the group security
from that share, either. That's a pretty much defunct relic of
the Windows Posix layer which would mimic the Unix security
model by giving every file a group and an owner. The owner
is still used sometimes. The group, probably never.

Have a look at this:

http://timgolden.me.uk/python/win32_how_do_i/add-security-to-a-file.html

to see if it helps you out.

There's definitely more I can add (and I would almost certainly
be combining the wmi & winsys modules to do this) but I'd like
to hear back from you first before I start going off down the
wrong track in my attempts to help.

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

Reply via email to