Jump to content

Recommended Posts

I have had a few clients that have had the request of having multiple business hours for differnt sites or departments for one reason for another. When you have alot of machines its not the best idea to just bounce to each machine and set the hours so I stumbled upon this and it has been a life saver.


Go to Asset Compliance > Configuration Items and right click to create a new configuraton item.



You create a discovery script to get your current settings:

$cmClientUserSettings = [WmiClass]"\\.\ROOT\ccm\ClientSDK:CCM_ClientUXSettings"
$businessHours = $cmClientUserSettings.GetBusinessHours()
$businessHoursCI = [string]$businessHours.StartTime + "," + [string]$businessHours.EndTime + "," + [string]$businessHours.WorkingDays
Return $businessHoursCI


It will return a value like 7,19,62 for 7 am to 7pm Monday-Friday all you would do to modify that is use the script below and the chart to add up the days.


Sunday 1 Monday 2 Tuesday 4 Wednesday 8 Thursday 16 Friday 32 Saturday 64


So if you would want Sunday - Saturday it would be 127 then 5am to 7 pm you would just modify the script to look like it does below.



You create a remediation script to set new business hours:

$startTime = 5
$endTime = 19
$workingDays = 127
$cmClientUserSettings = [WmiClass]"\\.\ROOT\ccm\ClientSDK:CCM_ClientUXSettings"
$businessHours = $cmClientUserSettings.PSBase.GetMethodParameters("SetBusinessHours")
$businessHours.StartTime = $StartTime
$businessHours.EndTime = $EndTime
$businessHours.WorkingDays = $WorkingDays

Try {
$result = $cmClientUserSettings.PSBase.InvokeMethod("SetBusinessHours", $businessHours, $Null)
If ($result.ReturnValue -eq 0 ) {
Else {
"Failed to set SCCM client business hours."
Catch {
"Failed to set SCCM client business hours."


You can then deploy that to every machine or if you would like to have multiple business hours you would make multiple configuration items then just deploy them to seperate collections. This has come in handy for me being able to set multiple business hours across a company, I hope somebody else finds it useful.




  • Like 1

Share this post

Link to post
Share on other sites

This looks like almost exactly what I am trying to accomplish. I am using SCCM 2012 SP1 CU4.


I followed your directions, but I don't understand how to check to see if this worked. Under Monitoring --> Deployments it shows successful, but that is just saying it was deployed successfully. How can I know if the script itself was successful?


On my test client that this was deployed to, I opened Software Center and click on Options. It still shows my business hours being 5:00 AM to 10:00 PM Monday through Friday.


Just for anyone else who needs to know...these are Windows PowerShell scripts.


The following guide was a little easier for me to understand:



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.

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.


  • Create New...