Jump to content


bcunjak

Established Members
  • Posts

    20
  • Joined

  • Last visited

Posts posted by bcunjak

  1. 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 ) {
    "Success."
    }
    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.

     

    Bryan

     

    • Like 1
  2. Hey guys,

     

    Windows 2008 r2 x64 / SCCM 2007 SP2 R2

    Clients are Windows 7 x86

     

    When our SCCM client installs on a machine after it is imaged it finds the site code right away but run advertised programs can take hours to populate.

     

    in execmgr.log i see these errors as soon as the client installs.

     

    Failed to instantiate UI Server {C2F23AE4-82D8-456F-A4AF-A2655D8CA726} with error 80004005
    Failed to instantiate UI Server 2 {E8425D59-451B-4978-A2AB-641470EB7C02} with error 80004005
    Failed to instantiate Updates UI Server {2D023958-73D0-4542-8AD6-9A507364F70E} with error 80004005
    Failed to instantiate VApp UI Server {00AAB372-0D6D-4976-B5F5-9BC7605E30BB} with error 0x80004005

     

    Hours later the machine will finally start pulling down the advertisements and run advertised programs is populated.

     

    If anybody has seen this before or has any idea let me know i'd greatly appreciate it.

     

    Thanks

    BC

×
×
  • 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.