Forum Discussion
Audit CMBaselineDeployment EvaluationSchedule
- May 03, 2022
Found another Function for a little bit more comfortable conversion...
https://www.powershellgallery.com/packages/PSCCMClient/0.2.2/Content/Public%5CConvertFrom-CCMSchedule.ps1
...with additional rows.
Function ConvertFrom-CCMSchedule { ...# insert from https://www.powershellgallery.com/packages/PSCCMClient/0.2.2/Content/Public%5CConvertFrom-CCMSchedule.ps1 } $Baselines = Get-WmiObject -class SMS_BaselineAssignment -namespace "root\SMS\site_$sitecode" Foreach ($Baseline in $Baselines) { [pscustomobject]@{ Baseline = $Baseline.AssignmentName EvaluationSchedule = ConvertFrom-CCMSchedule -ScheduleString $Baseline.EvaluationSchedule } }
Regards, G.
if someone needs the result...
Query:
Get-WmiObject -class SMS_BaselineAssignment -namespace "root\SMS\site_$Sitecode" | Select-Object -ExpandProperty EvaluationSchedule
Output:
EvaluationSchedule
------------------
0073CCC0001F2000
00D77CC000100008
00D4AC8000100600
00D77CC000100008
02D77CC000231400
...
This Objects are CM Schedule Strings and can be converted with....
Convert-CMSchedule -ScheduleString "< your scheduled string >
For example:
Convert-CMSchedule -ScheduleString "0073CCC0001F2000"
SmsProviderObjectPath : SMS_ST_RecurWeekly
Day : 7DayDuration : 0
ForNumberOfWeeks : 1
HourDuration : 0
IsGMT : False
MinuteDuration : 0
StartTime : 12/19/2021 3:00:00 AM
Found also a Function to grab it at once: https://xenit.se/blog/2017/04/18/convert-sccm-schedule-readable-format/
Function ConvertFrom-CMSchedule
{
....
}
$Baselines = Get-WmiObject -class SMS_BaselineAssignment -namespace "root\SMS\site_$Sitecode" | Select-Object AssignmentName,EvaluationSchedule
Foreach ($Baseline in $Baselines) {
#$Schedule = Get-WmiObject -class SMS_BaselineAssignment -namespace "root\SMS\site_$Sitecode" | Select-Object -ExpandProperty EvaluationSchedule | ConvertFrom-CMSchedule
[pscustomobject]@{
Baseline = $Baseline.AssignmentName
EvaluationSchedule = $Baseline | Select-Object -ExpandProperty EvaluationSchedule | ConvertFrom-CMSchedule
}
}
Regards, Geraldo
Found another Function for a little bit more comfortable conversion...
https://www.powershellgallery.com/packages/PSCCMClient/0.2.2/Content/Public%5CConvertFrom-CCMSchedule.ps1
...with additional rows.
Function ConvertFrom-CCMSchedule {
...# insert from https://www.powershellgallery.com/packages/PSCCMClient/0.2.2/Content/Public%5CConvertFrom-CCMSchedule.ps1
}
$Baselines = Get-WmiObject -class SMS_BaselineAssignment -namespace "root\SMS\site_$sitecode"
Foreach ($Baseline in $Baselines) {
[pscustomobject]@{
Baseline = $Baseline.AssignmentName
EvaluationSchedule = ConvertFrom-CCMSchedule -ScheduleString $Baseline.EvaluationSchedule
}
}
Regards, G.