This commit is contained in:
Zack Meier
2026-04-15 15:42:41 -05:00
parent 74edcc4d9a
commit 03dba08135
146 changed files with 9119 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
# Ashley's script to pull all OUs and their linked GPOs, dump to csv
$Timestamp = (Get-Date).ToString("yyyyMMdd_HHmmss")
Get-GPLinkReport | export-csv "D:\GPOs\^LinkReport\GPOLinks-$Timestamp.csv" -Force
# import-csv Ashley's report, filter only ITD
$LinkReports = Get-ChildItem "D:\GPOs\^LinkReport\" | Sort-Object LastWriteTime -Descending
$FirstNewest = $LinkReports | select -first 1
$SecondNewest = $LinkReports | select -first 2 | select -last 1
# check dates and backup any new changes
$compare = Compare-Object $FirstNewest $SecondNewest
$GPOs=Get-GPO -All
ForEach($GPO in $GPOs)
{
$GPOName = $GPO.DisplayName
$Timestamp = $GPO.ModificationTime.ToString("yyyyMMdd_HHmmss")
$FolderPath = "D:\GPOs\$GPOName\$Timestamp\"
If(!(Test-Path $FolderPath))
{
New-Item -Path $FolderPath -Force -ItemType Directory
}
$GPO | Backup-GPO -Path $FolderPath