This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SQL Query to show Policy to OU

Is there a SQL query that we can use to display Active Directory OU's and the Policy that is being applied to that OU.?

We have a very deep and convoluted OU structure and need a way to view policy application.



This thread was automatically locked due to age.
  • Hi Keith,

    this should give you an idea of your current policy assignment:

    USE SafeGuard
    SELECT
    POLICY.POL_NAME as 'Policy Name',
    SAFE_GUARD_DIR.SGD_NAME as 'Object Name',
    SAFE_GUARD_DIR.SGD_SCHEMA_CLASS_NAME as 'Object Class',
    SAFE_GUARD_DIR.SGD_DSN as 'Object Path'
    FROM OU_POLICY_ASSIGN
    INNER JOIN POLICY ON OU_POLICY_ASSIGN.OAS_POL_ID = POLICY.POL_ID
    INNER JOIN SAFE_GUARD_DIR ON OU_POLICY_ASSIGN.OAS_SGD_ID = SAFE_GUARD_DIR.SGD_ID
    ORDER BY SAFE_GUARD_DIR.SGD_DSN


    However, keep in mind that this does not represent an RSOP, as many additional factors come into play like policy activation for specific groups, evaluation order, no override, policy loopback etc.

     

    Hope that helps

    F. 

  • select name, is_policy_checked
    from sys.sql_logins 

    maybe it would be helpful to you as this command let you display active directory