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

Removing Group Policy links and objects


It is good to remove Group Policy objects and their links when they are no longer in use. Otherwise, it will create additional confusion while reviewing the policies through GPMC UI tools and also analyzing the GP result output from such environments is time-consuming as the computers and users have to process policies that are just linked to an OU but doesn't apply any policy to an object in particular.

The Group Policy module provides two cmdlets for this cleanup work, namely Remove-GPO and Remove-GPLink. As their names indicate, their purpose is to remove Group Policy and its links from an OU, domain, or site as shown by the following command:

Remove-GPO LogonPolicy

This command deletes the LogonPolicy GPO from the Group Policies store and also deletes links from OUs where it was linked. Use this approach when you are completely retiring the particular GPO from your environment. Removing a GPO causes its data to get deleted from the SYSVOL share...