Find all Empty GPO’s

Posted: October 16, 2012 in GPO, Scripts
Tags:

Easiest way to find empty GPO is to check the User and Computer version no of each and every GPO. If user and computer version no is zero then that GPO is considered as empty. So how do we check the version no ? If we have more than 100 GPO then it is difficult to check the version no one by one manually.. In this situation we can use the below powershell commands to query the version no of GPOs.

PowerShell Code:-

Import-module grouppolicy

$gpos = get-gpo -All

foreach ($item in $gpos) {

if ($item.Computer.DSVersion -eq 0 -and $item.User.DSVersion -eq 0) {

write-host $item.Displayname

}

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s