Tag Archives: vbs

Running a VBscript from batch (command line)

1 Nov , 2016,
, ,
No Comments

Most of the time a specific scripting language is chosen to provide an automated solution for something.
In this case a customer was already using batch scripting. I was adding simple VBscripts to query the WMI Namespaces. Well how to use these different scripts in hybrid and pass values back to the original batch startup script?

The VBS being used in this example is checking WMI for the Write Filter State (used in the Windows Embedded OS).
Microsoft is using the commands available to check and manage the filter and splitting the huge output to find the current state of the writefilter here. In my opinion it is better to use the information available in WMI:

The cscript //nologo is the most important part of the command you use to start the .VBS!
When we compare the output without the nologo switch we see these differences:

Now to call the and get it’s result and put it in a variable

BTW, Very usefull when creating WMI code is the WMI Code Generator created by Rob van der Woude.

How to escape SCCM Provisioning Mode (automated)

22 Nov , 2014,
, ,
No Comments

Provisioning mode is the state your SCCM client is in when deploying an OS via the task sequence. The client is installed in “provisioning mode” to prevent it from processing new policy requests until the task sequence is completed.

You can find its state in the registry;

HKLM\SOFTWARE\Microsoft\CCM\CcmExec\ProvisioningMode = True
HKLM\SOFTWARE\Microsoft\CCM\CcmExec\SystemTaskExclude = SchedulerStartup;SchedulerShutdown;SchedulerLogon;SchedulerLogoff;ClientRegistrationStartup

On a healthy machine that has finished a task sequence the ccmeval task changes these values when run succesfully. these registry values should be:

HKLM\SOFTWARE\Microsoft\CCM\CcmExec\ProvisioningMode = False
HKLM\SOFTWARE\Microsoft\CCM\CcmExec\SystemTaskExclude = (no value, should be blank)

In one situation (a year ago) I found out provisioning mode was not working correctly. Possibly caused by a bug because of an issue with mobileclient.tcf. This should be fixed in SCCM 2012 SP1 but we haven’t removed te fix for new deployments from our task sequence, just to be sure.

Read More…