In my previous blog post,i talked about how to compare 2 distribution points to see if they both have any applications mismatch.This blog post talks about how to distribute the missing apps to the Distribution Point.
I have used basic inbuilt Configmgr PowerShell commands for this activity,more via here
Get a list of applications,packages,drivers,Boot images ,OS images missing using SQL query from my previous blog or you can your own queries to get packages and server names.
Export the results into CSV file format which will be the input for our script to these apps to multiple Distribution Points.
Your csv file format should look like this:
Note:You do not need to install excel on the server from ,where you run the script.it is just csv ,works with notepad.
Below powershell script works for applications,packages,driver packages,boot images and OS images.
import-module F:\sccm\AdminConsole\bin\ConfigurationManager.psd1
#Change the site Code
$SiteCode = "P01"#Change File Location
Import-Csv C:\Users\eswar\Desktop\add-packages.csv |`
ForEach-Object {
$PackageType = $_.PackageType
$PackageName = $_.PackageName
$ServerName = $_.ServerName
#For packages
If($PackageType -eq "Package")
{
#echo "This is a Package"
start-CMContentDistribution -PackageName "$PackageName" -DistributionPointName "$ServerName"
}
#For applications
If($PackageType -eq "Application")
{
#echo "This is an Application"
start-CMContentDistribution -ApplicationName "$PackageName" -DistributionPointName "$ServerName"
}
#For Driverpackages
If($PackageType -eq "Driver")
{
#echo "This is a Driver"
Start-CMContentDistribution -DriverPackageName "$PackageName" -DistributionPointName "$ServerName"
}
#For BootImages
If($PackageType -eq "BootImage")
{
#echo "This is a BootImage"
Start-CMContentDistribution -BootImageName "$packagename" -DistributionPointName "$server"}
#For OSImage
If($PackageType -eq "OSImage")
{
#echo "This is a OSimage"
Start-CMContentDistribution –OperatingSystemImageName "$packagename" -DistributionPointName "$server"
}}
How to refresh package on many DP’s : http://eskonr.com/2013/09/sccm-configmgr-powershell-script-refresh-package-on-multiple-distribution-points/
Configmgr 2012:Updated PowerShell script add packages, applications,Drivers to Distribution Point is a post from: Eswar Koneti's Blog