We help IT Professionals succeed at work.

Determining the number of group policies

Simon336697 asked
Dear Everyone, hope you are all well and and can help.

Guys we have a 2003 AD domain.

What I want to do is to:

1) Determine by script, how many group policies we have
2) Determine how many of those are active (that is, not disabled)
3) Determine how many of those are inactive (that is, disabled)

Any help greatly appreciated.
Watch Question

Senior Active Directory Engineer
Top Expert 2012
You cannot add simply any attribute within ADUC to be able to modify it. It requires some programming stuff :/ and DLL rebuilding (if you ask if I can - no I can't :) )

There is only one way, you can do this simply and painless. You need appropriately written VBScript and you can add context menu on user's object using ADSIEdit. When you click right mouse button on a user then you will see that option which executes script. This would be something similar to EmployeeID example on Mike's blog at

and you can also add extra column to display (read-only mode) in ADUC when browsing users. You can also do that using ADSIEdit. Some short example at http://pberblog.com/post/2009/06/21/Add-extra-columns-to-Active-Directory-Users-and-Computers-display.aspx

Remember, do those changes in test environment to make sure that it works fine for you then implement theme in production

Krzysztof PytkoSenior Active Directory Engineer
Top Expert 2012

I'm sorry - wrong window :) answer for your question will be post soon ;)

Krzysztof PytkoSenior Active Directory Engineer
Top Expert 2012

I think you may be interested in PowerShell's Get-GPO cmd-let.

You need to run it on 2008R2 DC or workstations with RSAT Tools installed (first, you need to import GPO module for PS)

then you can  try with

Number of GPOs



Get-GPO -All | %{ $i=$i+1 }

Write-Host "Total GPOs: "$i

Open in new window

For other questions, see MS Technet forum at



Thanks everyone.
Sorry about the belated delay.
I wish you all a very happy Christmas and best new year for all of you.