Created
October 4, 2016 17:39
-
-
Save 1RedOne/e65154eaf6fdb189ab769dc36f91fa1e to your computer and use it in GitHub Desktop.
Automatic Client Upgrade
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $code = 'Your Three digit site code' | |
| while ($true){ | |
| $c= Get-CMCollection -Name 'Clients with < SCCM Version 1511' | select -expand MemberCount; | |
| $d = Get-CMCollection -Name 'Clients with > SCCM Version 1511' | select -expand MemberCount; | |
| $x = get-random -maximum 10 -minimum 1 | |
| "trying another $x clients" | |
| $r = get-cmdevice -CollectionName 'Clients with < SCCM Version 1511' | get-random -count $x | |
| $r | %{ | |
| Install-CMClient -DeviceName $_.Name -SiteCode $code -ForceReinstall $true -AlwaysInstallClient $True -IncludeDomainController $False | |
| } | |
| "Less than 1511 `t:$c" | |
| "More than 1511 `t:$d" | |
| timeout 180 | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment