MicrosoftDocs / sccm-docs-powershell-ref

Configuration Manager PowerShell documentation public repo
https://docs.microsoft.com/powershell/sccm/configurationmanager/
Creative Commons Attribution 4.0 International
26 stars 62 forks source link

New-CMSchedule with -start and -end parameters not working #256

Closed devFofo closed 2 years ago

devFofo commented 2 years ago

When running New-CMSchedule -Start $WindowStart -End $WindowEnd -IsUtc:$false -Nonrecurring with $WindowStart = Wednesday, March 9, 2022 12:00:00 AM and $WindowEnd = Wednesday, March 9, 2022 1:00:00 AM I'm getting as a result: SmsProviderObjectPath : SMS_ST_NonRecurring DayDuration : 0 HourDuration : 9 IsGMT : False MinuteDuration : 0 StartTime : 03/08/2022 4:00:00 PM

I've also tried without setting -IsUtc for a very similar answer: SmsProviderObjectPath : SMS_ST_NonRecurring DayDuration : 0 HourDuration : 9 IsGMT : False MinuteDuration : 0 StartTime : 03/08/2022 4:00:00 PM

The same script line worked a year+ ago when I used it to setup multiple schedules.

devFofo commented 2 years ago

Checking on SCCM interface you see that it created a 9 hour window, instead of a one hour window and starting at a weird time. image

aczechowski commented 2 years ago

Thanks @devFofo for taking the time to share this with the Configuration Manager documentation team. I’m sorry that you’re having problems, and I want to make sure it gets to the right people that can help. There are a couple of options available to provide the best level of support for this:

If it's a consistently reproducible issue, you can also file feedback via the product feedback portal. For more information, see Feedback for PowerShell.

I revised the New-CMSchedule article in August 2020, and would have tested the examples at that time. So I'm fairly confident they were working. It's possible that a bug was introduced since then, or possibly something wrong with the specific syntax that you're using. Either way, I'm closing this issue as there's nothing actionable for docs at this time. If you find that it's in fact a doc bug, please reopen this issue with additional details.