Working with links, enforcements, and order of GPOs

While learning about searching for Group Policies in previous sections, you have seen how to query GPOs linked to a given OU. When a GPO is linked to an OU, Link Enable is set to NO and Enforced is also set to NO. These are defaults; however, it is possible that some of the users might change these values over a period of time based on their needs. For example, the link might be enabled, enforcement might be enabled, and many more functions similar to this. So, how do we find these details using PowerShell so that we can find the exact status of Group Policies linked to an OU? The following function will help in finding this information.

This function queries the specified OU for a list of GPOs ...

Get Active Directory with PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.