SCCM 2012 Update existing collection schedule using Powershell

I found many articles how to set collection schedule for new collection, but unfortunately I didn’t found one that can describe me how to change existing schedule for collection. So I maintain own script. It’s quick and dirty.

#Import SCCM module
Import-Module 'D:\Program Files\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1'

# TT1 - SCCM Site Code
cd TT1:

# usercolls will keep filtered collection that we would like to changeSchedule, in my case there was "AppInst" string in Name
$usercolls = (Get-CMUserCollection | ?{$_.Name -like "*AppInst*" })

foreach ($coll in $usercolls){
# moreinfo about schedule - I randomized minutes and seconds for refresh, beacuse I choosed hourly interval, so there won't be mass query to DB for every hour at exactly same time
$newsched = New-CMSchedule -Start $((Get-Date).AddMinutes($(Get-Random -Minimum 0 -Maximum 59)).AddSeconds($(Get-Random -Minimum 0 -Maximum 59))) -DurationInterval Hours -RecurCount 1 -DurationCount 0 -RecurInterval Hours

$wcol = $coll.psbase.managedobject
$wsched = $newsched.psbase.managedobject

$wcol.RefreshSchedule = $wsched

$wcol.put()
}

I hope that it will be helpful for you!

SCCM 2012 Installation for lazy part 1 – SQL

In this post I will show you method of installation SCCM for lazy people (like I am). This can be useful for testing purposes as well it might be used in production. Main reason to develop those “scripts” was many dependencies that have to be meet before we install SCCM, like windows features, port configurations, optional product installation. In this article I will be base on Windows 2012 / Windows 2012 R2 with all commands, so let’s start.
Continue reading SCCM 2012 Installation for lazy part 1 – SQL

SCCM 2012 Installation for lazy part 2 – SCCM

Let’s go to Configuration Manager 2012  installation dependencies!

1. Install Windows feature dependencies at one big step

Run powershell, place windows CD/iso in cdrom drive (in my case D: )and type:

Continue reading SCCM 2012 Installation for lazy part 2 – SCCM