Prerequisites:
- Sccm Client Center
- Deployment id , package id ,program
- Windows PowerShell(by default)
- List of machines.
When there is a scenario where 15 percentages of machines where applications failed due to run time exceed error. The application uninstalled the older version but it doesn’t install the latest versions and throw error as Run time exceed even though the maximum Run time was extended to 45 mins.
The 15 percentage is almost 800 machines but rest of the machines was able to receive and get the application deployed successfully.
While the deployment\advertisement was re-run via sccm client center, the application was successfully deployed. Hence planned to automate the re-run task for 800 machines and it works like a charm
Solutions:
Hope most of us have seen the dll file in SCCM Client Center folder which is core for this application.
Powershell has the capability of working with dll files.
Script:
Add-Type -Path 'C:\SCCM Client Center\smsclictr.automation.DLL'
$strcomp=Get-Content "C:\computers.txt"
$strcomp | where{test-connection $_ -quiet -count 1} |ForEach-Object{
$ReRun = New-Object -TypeName smsclictr.automation.SMSClient($_)
$ReRun.SoftwareDistribution.RerunAdv("<Deploymentid>", "<PackageID>", "<PROGRAMNAME>")
}
Exceptions:
This script will fail to execute on below scenarios
- WMI Corrupted
- Access denied on target machines
- RPC issues
- When deployment is not targeted
Comments