Created
April 1, 2019 00:57
-
-
Save dstreefkerk/e1d8078603b38c28610c73fdf9cbe0a6 to your computer and use it in GitHub Desktop.
Get a count of GPOs created per year
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module GroupPolicy | |
$gpos = Get-GPO -All | Select-Object DisplayName,Description,CreationTime,DomainName | |
$gpos | Select-Object *,@{n='Year';e={$_.CreationTime | Get-Date -Format 'yyyy'}} | Group-Object -Property Year | Select-Object -Property @{n='Year';e={$_.Name}},@{n='Quantity';e={$_.Count}} | Format-Table -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment