Scripting Language and Region settings for current user, default user and welcome screen

At first glance, this seems like a simple and straight forward task; set the language and region for the current user, default user and welcome screen using command line tools. It’s easily done with the GUI, and Microsoft like to ensure that anything that can be done in the GUI can also be done in PowerShell, so this should be easy, no? Sadly, no.

Continue reading

Chef on Windows – detecting and fixing WMI problems which prevent chef-client runs

At thetrainline.com we use Opscode Chef for managing our build infrastructure. Like many other tools running on Windows, the chef-client ohai framework relies on WMI for extracting information about the server machine on which scripts are being run. We found that Windows WMI repository corruption can cause chef-client runs to fail due to missing WMI classes, which causes the node to remain out of policy. The WMI repo can be repaired using winmgmt /salvagerepository, and the WMI errors can be monitored using the WMIDiag script to alert on WMI repository corruption before future chef-client runs. This post details how we detected and fixed the problem, and how to monitor for WMI repository corruption.

Continue reading