Apr 30 2022 05:43 AM
Hi guys,
does anyone have a method to display the Baseline deployment "EvaluationSchedule" in a readable format or list?
Like the "Get-CMPackageDeployment -Name "Deployment Test" | Select-Object PackageID, ProgramName, CollectionID, AssignedSchedule" but in "Get-CMBaselineDeployment -Fast -Name "Baseline1" | Select-Object AssignmentName,EvaluationSchedule".
Maybe a chance with an SQL query?
The current output always show an encrypted string.
Need that to Audit an Optimize the Deployments to not overlap.
Regards.
May 02 2022 09:01 AM - edited May 02 2022 09:02 AM
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: Convert SCCM schedule to 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
May 03 2022 01:56 AM
SolutionFound another Function for a little bit more comfortable conversion...
...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.
May 03 2022 01:56 AM
SolutionFound another Function for a little bit more comfortable conversion...
...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.