-
-
Save danjpadgett/bc60b09e4e78880923df to your computer and use it in GitHub Desktop.
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
<# | |
.SYNOPSIS | |
Backup all task sequences to disk greater than $minDate | |
.DESCRIPTION | |
TS backup will fail if TS name has special characters not allowed, edit sitecode and destinationpath | |
.PARAMETER <Parameter_Name> | |
None | |
.INPUTS | |
None | |
.OUTPUTS | |
None | |
.NOTES | |
Version: 4.0 | |
Author: dpadgett/https://execmgr.net | |
Creation Date: 270617 | |
Purpose/Change: Initial script development | |
.EXAMPLE | |
None | |
#> | |
##Modify ConfigMgr Path if necessary## | |
Import-Module 'D:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1' | |
##Enter Site Code Below### | |
CD XXX: | |
[datetime]$minDate = "1/1/2017 00:00:00 AM" | |
$ts = Get-CMTaskSequence | Where-Object {$_.SourceDate -gt $minDate} | |
$time = get-date -format ddMMyyyy | |
New-Item -Path "E:\Source\ITS\TSBackups\Backups\$time" -ItemType Directory | |
foreach ($t in $ts){ | |
$path = "E:\Source\ITS\TSBackups\Backups" | |
$exportname = $t.Name | |
Export-CMTaskSequence -TaskSequencePackageId $t.PackageID -ExportFilePath "$path\$time\$exportname.zip" -Verbose | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment