Change the value of ScriptExecutionTimeOut property during a task sequence.

Simon Bond 6 Reputation points
2021-10-05T16:00:59.293+00:00

I have a driver app that uses Powershell script detection and just occasionally, the script over-runs the 60s default, causing the upgrade to fail. There are a number of 'solutions' to this such as those at the bottom of this question but I have been unable to find a way to change the default on a client during the course of a task sequence. I suspect this is partly due to the fact that CCMExec is in the provisioned state during this time and the full WMI 'featureset' is unavailable. Certainly one is unable to query or set this value with Powershell as far as I can tell.
However, if you run up a WBEMTest session during a task sequence, then connect to the namespace and enumerate all classes you ARE able to find the class and the Script Timeout property. If you then change the property and save the object then it is possible to change the value.
So my question is, given that it appears possible to change the value using WBEMTest, why is it not possible (to my knowledge at least) to do this via the command line? I would point out that the installed SCCM client also fails to inherit the site settings for this if you happen to have changed the ScriptExecutionTimeout property there.

Server Side:
https://learn.microsoft.com/en-gb/archive/blogs/fei_xias_blog/system-center-2012-configmgr-using-vbs-to-extend-the-dcm-script-execution-timeout-value
Client Side:
Set-WmiInstance -Path "root\ccm\policy\machine\actualconfig:CCM_ConfigurationManagementClientConfig.SiteSettingsKey=1" -Arguments @{ScriptExecutionTimeOut=400}

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,378 questions
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager Deployment
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Deployment: The process of delivering, assembling, and maintaining a particular version of a software system at a site.
905 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Jason Sandys 31,156 Reputation points Microsoft Employee
    2021-10-05T19:50:05.437+00:00

    why is it not possible (to my knowledge at least) to do this via the command line?

    Can you be more specific on what exactly doesn't work here? What do you mean by command-line and what exactly fails when trying with this method?

    1 person found this answer helpful.
    0 comments No comments

  2. Simon Bond 6 Reputation points
    2021-10-06T08:30:58.08+00:00

    Hi Jason, thanks for replying. Some examples: If I hit F8 during the task sequence and run: gwmi -namespace root\ccmpolicy\machine\requestedconfig -query "Select * From CCM_ConfigurationManagementClientConfig" then this returns nothing, whereas with a 'full' client this returns data including the ScriptExecutionTimeout value and other settings below. Similarly, if I were to run: Set-WmiInstance -Path "root\ccm\policy\machine\actualconfig:CCM_ConfigurationManagementClientConfig" -Arguments @{ScriptExecutionTimeOut=400} then this returns 'Illegal null value' error. Note I don't include the '.sitesettingskey=1' here as this value is indeed null when the CM client is in provisioning mode, as can be shown if you run WBEMTest in provisioning mode, see attached screenshot and mof values below: class CCM_ConfigurationManagementClientConfig : CCM_ComponentClientConfig { [realkey] uint32 SiteSettingsKey; uint32 PerProviderTimeOut; uint32 ScriptExecutionTimeOut = 60; uint32 PerScanTimeout; uint32 PerScanTTL; boolean EnableUserStateManagement = FALSE; string Reserved1 = ""; string Reserved2 = ""; string Reserved3 = ""; }; As you can also see, the ScriptTimeOut value is actually present though. In WBEMTest, if I change this value, hit Save Property then Save Object then the value is indeed changed and sticks. I just don't know how to change that property via Powershell or any other commandline way from within a task sequence. Note, the mof values above are the default whereas I have manually changed the ScriptTimeout Value to 340 in the attached image via WBEMTest (other values remain the same). Hope this is a little clearer! Thanks /api/attachments/138020-wbemtest-prov.png?platform=QnA

    1 person found this answer helpful.

  3. Limitless Technology 39,356 Reputation points
    2021-10-06T19:34:38.577+00:00

    Hello anonymous user

    There is a Technet discussion which might be helpful for you. It is a bit old but provides some of a workaround:

    How to increase script execution timeout for compliance settings scripts

    https://social.technet.microsoft.com/Forums/en-US/e77513e1-4f1d-469b-b9da-ccc8ac0b231a/how-to-increase-script-execution-timeout-for-compliance-settings-scripts?forum=configmanagergeneral

    -------
    --If the reply is helpful, please Upvote and Accept as answer--

    1 person found this answer helpful.