OSConfig will create a Registry Snapshot CMD file at C:\Windows\OSConfig\Registry\_Snapshot.cmd
OSConfig will create a backup of most of the Registry before and after the main routine is executed in C:\Windows\OSConfig\Registry\Backup. This allows for your to validate any changes that were made by OSConfig, or to use them to reset a setting to default. As you can see they are sorted in pairs showing an export before and after OSConfig has run.
After OSConfig has completed running, the content to OSConfig will be persistent in C:\Windows\OSConfig
In our first run, we provided the $OEM$, Settings, and Theme directories, but Logs and Registry are created by OSConfig. This post will review the Logs directory
I’ve made some changes to OSConfig that change some of my previous posts, so I’m going to go through and update everything. Here are the changes:
- Sample Reg files have been removed so I can work on a template
- Sample directory has been added. Appx and a Windows 10 theme are in there for now
- Minor changes to the VBS and WSF scripts themselves. Make sure you get the latest update from GitHub. For download instructions, read Tool: OSConfig Download
You can always get to view all OSConfig posts at https://winpeguy.wordpress.com/my-scripts/tool-osconfig/
Or by using “The Pages” link in the upper right corner of my blog
One of the neat things about ZTIOSConfig.wsf is that it only copies what it needs from the Deployment Share and moves everything into a proper format. In the example below OSConfig was copied to a Windows 10 deployment (in WinPE). The contents of my %DeploymentShare%\Applications\OSConfig\Windows 10 is what we see in C:\_SMSTaskSequence\OSConfig (and the OSConfig.vbs obviously).
There may be times you want to apply a Setting one time only to a Deployment, and since OSConfig keeps things persistent at C:\Windows\OSConfig, you want to make sure it doesn’t get run a second time in the future. Simply add a RunOnce to the name of the Settings file and OSConfig will move the file to C:\Windows\OSConfig\Settings\RunOnce after it has been processed. This can be combined with another naming convention like TSYes or x86. Additionally if I give the file a name that starts with 00, since the files are run in Sort Order, it will run first before anything else. In the example below I have added 00 TSYes RunOnce – Clear All Windows Update Configuration.cmd to wipe out all the WSUS information in case I didn’t clear this in my Captured Image.
There are some settings that I make only in a Task Sequence. For example I want to disable System Restore while I am deploying an Operating System, but I want System Restore enabled by default normally. In this case, I will simply add a TSYes or TSNo to the name of my Settings file. OSConfig will detect if it is running in a Task Sequence, and if so, it will apply anything with TSYes, and will not apply anything with TSNo. I just have to remember to enable System Restore manually at the end of my Task Sequence in a separate step.
Since OSConfig isn’t segmented by Operating System Architecture, all Settings are applied to the OS. If you need to apply a Setting to a specific Architecture only, simply name the file with x86 or x64. OSConfig will only apply the appropriate file. In the example below I had two files (x86 and x64). Only the x86 was applied to my Windows 10 x86 deployment, while the x64 version of the file was moved to C:\Windows\OSConfig\Settings\NotApplicable . . . and the OSConfig.log reflects this as well.
So I’m a jerk when it comes to locking down some settings. Two setting that I locked down were the ability to change the Lock Screen image, and I also disabled OneDrive for file storage. But what if I wanted to just disable them by default, but have a way to easily undo these settings. Simple . . . I create an Undo file in my OSConfig\Settings.
As you can see in the image below I have paired off these restrictions, and their corresponding “undo”.
As you can see from the OSConfig.log, any file with Undo in the name (not case sensitive) are skipped, just like files with Sample in the name. This gives me an easy way to allow someone to undo the damage that I have done.
So you want to remove some Appx Packages from Windows prior to first logon? Easy enough. If you have run OSConfig on a system go to C:\Windows\OSConfig\Logs and look in AppxPackage.txt. In there it will give you a list of all Packages that are staged to be installed. Just decide which ones you don’t want installed. This post relates to Windows 10, but Windows 10 configuration is the same.