Jump to content


MikhailCompo

How Do I Change Using PowerShell the Default Client Settings Hardware Inventory Schedule?

Recommended Posts

I need a command line that can be run on a number of SCCM environments that changes the HW Inventory Schedule from 7 days to 1 day (Default Client Settings). This cannot be done manually (dont ask!).

 

Get-CMClientSetting -Setting HardwareInventory

Using the docs.microsoft.com pages below, I have established using Get-CMClientSetting that my current 7 day schedule the value is 000120000010038. After manually changing the schedule to 1 day, that value changes to 000120000010008


When I try to use Set-CMClientSetting it will not accept the value that is shown above.

My command line is the following, is it that which is wrong? Or should I interpret the value differently?

Set-CMClientSetting -Name "Default Client Settings" -HardwareInventorySettings -InventorySchedule 000120000010008

 

https://docs.microsoft.com/en-us/powershell/module/configurationmanager/get-cmclientsetting?view=sccm-ps

https://docs.microsoft.com/en-us/powershell/module/configurationmanager/set-cmclientsettinghardwareinventory?view=sccm-ps

 

Thanks for any help!!

Share this post


Link to post
Share on other sites

Check out WMI trigger without client settings change:

https://rid500.wordpress.com/2017/07/23/sccm-refresh-machine-policy-retrieval-evaluation-cycle-via-wmi/

Or, create new custom client settings and deploy to a collection in which you put your targeted devices.

For a one time job, I remote to the machine using psexec \\hostname cmd.exe and then run:

WMIC /namespace:\\root\ccm path sms_client CALL TriggerSchedule "{00000000-0000-0000-0000-000000000001}" /NOINTERACTIVE

Share this post


Link to post
Share on other sites

Thanks for responding, but i think you haven't fully read my post.

I require a script which can change the Default Client Settings. This is a script to run on the server, not on clients. I dont care about a specific device sending a HW scan. I need the policy to change the Default Client Settings so that all devices send inventory every day (not every 7) forever.

It is possible with powershell juding by the MS Docs, but i cannot get a command line working.

I need someone with better PowerShell skills that me...

Share this post


Link to post
Share on other sites

I have managed to work this out.

I realised that the value returned using Get-CMClientSettings was possibly an array. Hence why using Set-CMClientSettings does not accept an integer. I then re-read the MS Docs and found the function New-CMSchedule

Using that function, i first set a variable and then used that with the Set-CMClientSettings function, creating the following script that will set the HW interval to 1 day
 

$HWInvSched = New-CMSchedule -RecurCount 1 -RecurInterval Days
Set-CMClientSetting -Name "Default Client Agent Settings" -HardwareInventorySettings -InventorySchedule $HWInvSched

 

Hope this helps someone else!

Share this post


Link to post
Share on other sites

Do you have any custom script to add/modify Remote Tools in default client settings. I am looking and trying to create custom client settings with selected settings like Remote Tools, Hardware Inventory etc., Please help on this

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.