ArcGIS - Python- Privs Scripts

289
1
10-02-2012 09:57 AM
MelissaStenger
New Contributor
I am new to ArcGIS.

We are using ArcGIS 10.0 .
We are sunning SQL 2008 R2 with SQL role based security connected to Active directory global groups.
We are connecting using the connection properties... sde:sqlserver:<servername\instance> with OS authentication.

We are in a rebuild mode, which requires the administrator to re-apply permissions to an average 50 items in catalog with more than 50 AD global groups for each item.

This is quite time consuming...  ;(

Does anyone have a python script for doing this?

Melissa
Tags (2)
0 Kudos
1 Reply
MathewCoyle
Frequent Contributor
Not sure if this is what you are looking for. I use DB managed groups instead of AD users, so you will need to find a way to tap into AD to get your list of users to grant the privileges to and loop through them. The win32api or active_directory modules should be able to get what you want.

http://timgolden.me.uk/python/active_directory.html
http://www.python.org/getit/windows/

import arcpy
sde = r"sde_instance_path.sde"
arcpy.env.workspace = sde
fc_List = arcpy.ListFeatureClasses("some_filter")
fc_List.sort()
for fc in fc_List:
    try:
        print "Granting privileges to " + fc
        arcpy.ChangePrivileges_management(fc, "# group/user to grant priv", "GRANT")
    except:
        print "Passing " + fc
        pass
0 Kudos