Import and Export Configuration Manager Baselines using PowerShell

This script allows you to export and import Configuration Manager baselines. It uses the Get-CMBaseline PowerShell command to retrieve a list of all available baselines, export each to a .cab file, and then import the files into Configuration Manager. This can save time and effort for administrators who need to transfer baselines between different environments or maintain backups regularly.
#Run these commands on Site A and copy the files.
$Baselines = Get-CMBaseline
Foreach($Baseline in $Baselines){
Export-CMBaseline -Id $Baseline.CI_ID -Path "C:\TEMP\$($Baseline.LocalizedDisplayName).cab"
}
#Run this on Site B to import all Baselines
$Files = Get-ChildItem -Path "C:\TEMP\"
foreach($CAB in $Files){
$CAB.FullName
Import-CMBaseline -FileName $CAB.FullName -Verbose -Force
}
Summary
"Are you looking to automate your Configuration Manager tasks? Look no further! I can create custom PowerShell scripts to streamline your workflow and save you time.
Member discussion