Quantcast
Channel: rakhesh – rakhesh.com
Viewing all articles
Browse latest Browse all 742

Find all GPOs modified yesterday

$
0
0

Via PowerShell, of course:

Get-GPO -All | ?{ ([datetime]::today - ($_.ModificationTime)).Days -le 1 } | ft DisplayName,ModificationTime

And to make a report of the settings in these same GPOs:

Get-GPO -All | ?{ ([datetime]::today - ($_.ModificationTime)).Days -le 1 } | %{ Get-GPOReport $_.DisplayName -ReportType HTML } > Report.html

Yeah, I cheated in the end by using > rather than Out-File. Old habits. :)

Not sure why, but doing a search like Get-GPO -All | ?{ ($_.ModificationTime) -eq [datetime]"18 September 2017" } doesn’t yield any results. I think it’s because the timestamps don’t match. I couldn’t think of a way around that.


Viewing all articles
Browse latest Browse all 742

Trending Articles