Blog

Getting Group Policy Counts with PowerShell

Posted by:

Sometimes you want to know how many GPOs you have in a domain. Powershell provides a way to do this quickly and easily. Earlier today I tweeted about the way to do this in Windows 7 or Server 2008-R2, using the Microsoft-provided “GroupPolicy” PowerShell Module. Its as simple as:

(Get-GPO -All).Count

However, if you are not yet on these newer OS versions, you can still get this information from PowerShell. Specifically, my free PowerShell GPMC cmdlets provide nearly identical syntax to the MS ones, but on earlier versions of the OS (i.e. 2008, XP and 2003). The syntax is:

(get-sdmGPO *).Count

Quick, and easy!

Darren

0


About the Author:

Darren Mar-Elia is CTO & Founder of SDM Software, Inc. Darren has over 25 years of IT and Software experience in the Microsoft technology area, including serving as a Director in Infrastructure at Charles Schwab, CTO of Windows Management Solutions at Quest Software, and Sr. Director of Product Engineering at DesktopStandard. He has been a Microsoft MVP in Group Policy technology for the last 6 years and has written and spoken on Active Directory, Group Policy and PowerShell topics frequently over the years. He maintains the popular Group Policy resource web site at www.gpoguy.com and has been a contributing editor for Windows IT Pro Magazine since 1997. He has written and contributed to twelve books on Windows. Darren also speaks frequently at conferences on Windows infrastructure topics.

Add a Comment