Here is a really simple Configuration Manager Client installation PowerShell workflow. This workflow queries all the clients where ClientType property is NULL. You can easily add logging, scheduling etc.
workflow Install-CMClient { Param( $SiteCode, $SiteServer ) $Computers = Get-WmiObject -Namespace "Root\SMS\Site_$($SiteCode)" ` -Query "Select Name from SMS_R_System where ClientType is NULL" -PSComputerName $SiteServer Write-Output -Input "Total computers without Configuration Manager Client:$($Computers.Count)" ForEach -parallel ($item in $Computers){ $Path = "\\$($item.Name)\c$" if(Test-Path -Path $Path) { Write-Output -Input "Copying installation files to $($item.Name) TEMP folder" Copy-Item -Path "\\Terminaator\CMClient" -Destination "\\$($item.Name)\c$\TEMP" -Recurse -Force Inlinescript{ Write-Output -Input "Starting CCMSETUP.EXE on $($Using:Item.Name)" Start-Process -FilePath "C:\TEMP\CCMSETUP.EXE" } -PSComputerName $item.Name } Else{ Write-Output -Input "----- Cannot access $Path -------------" } } } Install-CMClient -SiteCode TPT -SiteServer Localhost
This workflow generates following output.
Thanks for the great script. How hard would it be to add or include by collections? I am working with a client now that wants to install the client by location. We have collections created based off of office locations. We are still in the process of deploying Distribution Points to each of these sites so that is the reason behind needed to focus on collection as well.