I have found a script to help me migrate some of my packages from SCCM 2007 to SCCM 2012. It doesnt always seem to work so I would like to export the results to an excel sheet or a log. I have no idea how to do that however. Does anyone know the best way to do that?
$sitecode = "SITE CODE"$source = "Old Path"
$dest = "New Path"
$packages = Get-WMIObject -namespace "root\sms\site_$sitecode" -class SMS_Package
foreach ($package in $packages) {
$id = $package.PackageID
$single = Get-WMIObject -namespace "root\sms\site_$sitecode" -class SMS_Package -filter "PackageID='$id'"
foreach ($object in $single) {
$path = $object.PkgSourcePath.Replace($source, $dest)
$object.PkgSourcePath = $path
$object.Put()
}
}
"You can't fix stupid!"