The "looping" version of that with computer name strings would look something like this:
foreach ( $computerName in $computerNames ) {
([WMIClass] "\\$computerName\root\CCM\ClientSDK:CCM_SoftwareUpdatesManager").InstallUpdates([Management.ManagementObject[]])
Get-WmiObject -ComputerName $computerName -Query "SELECT * FROM CCM_SoftwareUpdate" -Namespace "root\ccm\ClientSDK"
}
This presumes that the variable $computerNames
has a list of computer names, one per line, and that the host-based firewall on each machine you want to connect to will allow the connection.