New-CMSchedule and -DayOfWeek

I'm trying run the following to configure discovery in ConfigMgr 2012 R2, but get an error with the schedule.  What am I doing wrong?  If I use a 7 day cycle instead of trying the -DayOfWeek options, everything works. I want discovery to run every Sunday at 4:00 AM.

Cannot bind argument to parameter 'PollingSchedule', because PSTypeNames of the argument do not match the PSTypeName required by the parameter: IResultObject#SMS_ST_RecurInterval

$Site = Get-CMSite

$Sched = New-CMSchedule -Start "01/01/2015 04:00 AM" ` -DayOfWeek Sunday -RecurCount 1 # Enable and Configure Active Directory System Discovery Set-CMDiscoveryMethod -ActiveDirectorySystemDiscovery ` -SiteCode $Site.SiteCode ` -Enabled $True ` -PollingSchedule $Sched ` -EnableDeltaDiscovery $True ` -DeltaDiscoveryIntervalMinutes 5 ` -EnableFilteringExpiredLogon $True ` -TimeSinceLastLogonDays 90 ` -EnableFilteringExpiredPassword $true ` -TimeSinceLastPasswordUpdateDays 90





  • Edited by jsc.19 Monday, July 27, 2015 6:44 AM
July 27th, 2015 6:40am

The issue is that discovery they dont have days for option so you can`t set every sunday.

What you will need to do is this:

$Sched = New-CMSchedule -RecurInterval days -Start "15/01/04 04:00 AM" -RecurCount 7

So you need to make sure that the start day is a sunday

So with the recurcount at 7 means that it will run every 7 days

So the schedule i link you start 04 = sunday 01 = january = 04:00 AM well 4 am

Hope this helps

Free Windows Admin Tool Kit Click here and download it now
July 27th, 2015 7:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics