Book Image

Active Directory with PowerShell

By : Pamarthi Venkata Sitaram, YELLAPRAGADA U PADMAVATHI
5 (1)
Book Image

Active Directory with PowerShell

5 (1)
By: Pamarthi Venkata Sitaram, YELLAPRAGADA U PADMAVATHI

Overview of this book

Table of Contents (16 chapters)
Active Directory with PowerShell
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 linked, their Link Enable status, enforcement status, and the link order of GPOs. You can refer to the TechNet page at http://technet.microsoft.com/en-us/library/hh147307%28v=ws.10%29.aspx to understand these GPO parameters better:

function Get-GPOLinkStatus...