Today I tried to modify Hardware Inventory Schedule client setting and it didn’t work. First I thought that I did something wrong or the cmdlet is broken. Here is the cmdlet Verbose output
Then I thought that, lets disable the HW client setting and then enable the HW client setting with correct schedule and Bingo it worked correctly.
#Step 1 $ClientSettingsName = 'HW Settings' Set-CMClientSetting -Name $ClientSettingsName -EnableHardwareInventory $false -Verbose -Debug #Step 2 $CMWeeklySchedule = New-CMSchedule -RecurCount 1 -RecurInterval Hours Set-CMClientSetting -InventorySchedule $CMWeeklySchedule -Name $ClientSettingsName -EnableHardwareInventory $True -Verbose -Debug
If you compare the verbose outputs, then you will see the difference – first time it didn’t query the SMS_SCI_ClientComp WMI instance but second time it did.
Now If I try to modify the schedule again I don’t need to disable the HW setting. I tested this on Configuration Manager 2012 R2 CU1 lab.
Do you know how to set a schedule using PS, for “Set-CMClientSettingSoftwareInventory -Name “Custom Client Settings” -Schedule”
I used Get-CMClientSetting -Name “Default Client Agent Settings” -Setting SoftwareInventory to see what the value was for Schedule, which was “0001200000100018”. But if I put that value in the Set-CMClientSettingSoftwareInventory -Name “Custom Client Settings” -Schedule 0001200000100018 it spits out an error. and I am stuck on this.
This is the error.
Set-CMClientSettingSoftwareInventory : Cannot bind parameter ‘Schedule’. Cannot convert the “1200000100038” value of type “System.Int64” to type
“Microsoft.ConfigurationManagement.ManagementProvider.IResultObject”.