Last week I discovered that you can create a Refresh Schedule with New-CMSchedule cmdlet and then you can easily use that object with Get-WmiObject cmdlet to query and modify for example Device Collection Refresh Schedule.

Import-Module $env:SMS_ADMIN_UI_PATH.Replace("\bin\i386","\bin\configurationmanager.psd1") $SiteCode = Get-PSDrive -PSProvider CMSITE Set-Location "$($SiteCode.Name):\" $Schedule = New-CMSchedule -RecurCount 2 -RecurInterval Days $Collection = Get-WmiObject -Namespace "Root\SMS\Site_PS1" -Class SMS_Collection -Filter "Name='Windows 8.1 OSD'" $Collection.RefreshType = 2 $Collection.RefreshSchedule = $Schedule.psbase.ManagedObject $Collection.Put()

You can create the Device Collection with correct Refresh Schedule but Set-CMDeviceCollection cmdlet does not allow to change the Refresh Schedule.

$Schedule = New-CMSchedule -RecurCount 2 -RecurInterval Days New-CMDeviceCollection -Name "Windows 7 OSD" -LimitingCollectionName "All Systems" -RefreshSchedule $Schedule

Set-CMDeviceCollection cmdlet parameters

image

 

I tested this on Windows Server 2012 R2 RTM and with System Center Configuration Manager 2012 R2.