2

I've managed to use a Baseline Configuration to set business hours for my clients via remediation.

I'd like to do the same/similar for "Automatically install or uninstall required software and restart the computer only outside of the specified business hours" checkbox.

BACKGROUNDER

We used to install updates as soon as they came in... users don't like it so much when .NET churns their PC for an update, so I set an installation deadline of 7 days from when they are found via ADR.

The settings say "after deadline - install outside of maintenance window" I have updates that just came into my PC and are saying "What do you want to do with these"

Well, I'd LIKE these updates to install at the first available maintenance window and I think I need that little box checked, or will they install tonight, whether I do anything or not?

dragonspeed
  • 145
  • 2
  • 8

2 Answers2

1

Well, I'd LIKE these updates to install at the first available maintenance window and I think I need that little box checked, or will they install tonight, whether I do anything or not?

solution http://www.myitforum.com/forums/Software-Center-Business-Hours-and-Computer-Maintenance-m244096.aspx

sccm31337
  • 26
  • 1
  • Please note, a link only answer is no good. If the link is not available, the answer won't help. So add some more information as to how this link can help answer the question. – Diamond Dec 15 '15 at 10:45
0

That link brings you to another link which has the script I was looking for:

Powershell

$Return = Invoke-WmiMethod -Namespace “Root\ccm\ClientSDK” -Class CCM_ClientUXSettings -Name SetAutoInstallRequiredSoftwaretoNonBusinessHours -ArgumentList @($TRUE) -ComputerName $ComputerName -ErrorAction STOP

VBScript

Set objUX = GetObject("winmgmts:\\.\root\ccm\ClientSDK:CCM_ClientUXSettings")
Set inParam = objUX.Methods_.Item("SetAutoInstallRequiredSoftwaretoNonBusinessHours").inParameters.SpawnInstance_()
inParam.AutomaticallyInstallSoftware = "True"
Set result = objUX.ExecMethod_("SetAutoInstallRequiredSoftwaretoNonBusinessHours", inParam)

Or From Command line with WMIC.exe (/node:PC_Name can be inserted after wmic to execute on remote system):

wmic /namespace:\\Root\ccm\ClientSDK CLASS CCM_ClientUXSettings CALL SetAutoInstallRequiredSoftwaretoNonBusinessHours 1
Frederik
  • 3,293
  • 3
  • 30
  • 46
dragonspeed
  • 145
  • 2
  • 8
  • And for DCM detection: $Return = (Invoke-WmiMethod -Namespace “Root\ccm\ClientSDK” -Class CCM_ClientUXSettings -Name GetAutoInstallRequiredSoftwaretoNonBusinessHours).Properties["AutomaticallyInstallSoftware"].value Where TRUE if set and FALSE if not. – dragonspeed Dec 15 '15 at 15:37