Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

SCCM install update via command line

function trigger-AvailableSupInstall
{
 Param
(
 [String][Parameter(Mandatory=$True, Position=1)] $Computername,
 [String][Parameter(Mandatory=$True, Position=2)] $SupName
 
)
Begin
{
 $AppEvalState0 = "0"
 $AppEvalState1 = "1"
 $ApplicationClass = [WmiClass]"rootccmclientSDK:CCM_SoftwareUpdatesManager"
}
 
Process
{
If ($SupName -Like "All" -or $SupName -like "all")
{
 Foreach ($Computer in $Computername)
{
 $Application = (Get-WmiObject -Namespace "rootccmclientSDK" -Class CCM_SoftwareUpdate -ComputerName $Computer | Where-Object { $_.EvaluationState -like "*$($AppEvalState0)*" -or $_.EvaluationState -like "*$($AppEvalState1)*"})
 Invoke-WmiMethod -Class CCM_SoftwareUpdatesManager -Name InstallUpdates -ArgumentList (,$Application) -Namespace rootccmclientsdk -ComputerName $Computer
 
}
 
}
 Else
 
{
 Foreach ($Computer in $Computername)
{
 $Application = (Get-WmiObject -Namespace "rootccmclientSDK" -Class CCM_SoftwareUpdate -ComputerName $Computer | Where-Object { $_.EvaluationState -like "*$($AppEvalState)*" -and $_.Name -like "*$($SupName)*"})
 Invoke-WmiMethod -Class CCM_SoftwareUpdatesManager -Name InstallUpdates -ArgumentList (,$Application) -Namespace rootccmclientsdk -ComputerName $Computer
 
}
 
}
}
End {}
}
Comment

PREVIOUS NEXT
Code Example
Shell :: start adb exe manually if necessary 
Shell :: Warning: Pub installs executables into $HOME/.pub-cache/ 
Shell :: Using 32768KiB of shared memory for nchan 
Shell :: edit git commits 
Shell :: powershell autocompletion 
Shell :: jenkins pipeline for sonarqube 
Shell :: not found the requested url was not found on this server. apache/2.4.41 (ubuntu) server 
Shell :: install Open broadcaster software. Free video recording software for linux 
Shell :: how to fix expired key when apt update 
Shell :: how to close firebase emulator hosting 
Shell :: Unable to install modules kint due to missing modules kint. 
Shell :: pip install PyPortfolioOpt 
Shell :: how to close git issue with fixes automaticallt 
Shell :: laravel sail 
Shell :: git for nube 
Shell :: how to monitor my applications net http traffic locally in terminal 
Shell :: ahk get command line 
Shell :: clamscan version command 
Shell :: To check the Logs in Ubuntu and Debian 
Shell :: linux maximize window 
Shell :: check space available ubuntu gui 
Shell :: mongo shell query for email domain regex 
Shell :: how to install rfkill in kali linux 
Shell :: how to creare 2 shotcut links of 2 exe in inno 
Shell :: bash similiar to choice in cmd 
Shell :: sh /usr/lib/systemd/scripts/vmware no such file or directory 
Shell :: uninstall libxcb 
Shell :: sbt debian 
Shell :: start cinnamon from command line redhat 7 
Shell :: return wm_class 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =