Friday, May 25, 2012

Windows 7 Customizations

So I have been working with a client these past two weeks on their Windows 7 image, attempting to get them from a full wim image (replacing ghost) to a single scripted image, with no applications pre-installed into the image.

During the installation process, of course, we do want certain settings to be set for the customer that give Windows 7 the look and feel that they are looking for.  This includes things like:
  • Small icons on the task bar
  • Small icons on the desktop
  • Show Start -> Run
  • Show Administrative Tools in the Start Menu
  • Turn on Desktop icons for My Computer, Network, My Documents, etc
I decided that I need a place to put all of that information, as I know that sitting in my brain is the short term solution and I want something that will be a little more long lasting and ... well, permanent.

Let's start with, I'm a fan of performing a "From the DVD scripted installation", removing the intricacies of maintaining a golden image every so often with the latest updates from all of the vendors for all of the software that is included with the image.

Of course, to do this successfully, one must keep the desired image changes (background images, default user settings such as small icons, etc) located in a central location and applied via a script in the postinstall phase of their Task sequence.

Service Manager 2012 - Preview

There's a new contestant on the scene for being my first customer to receive a little System Center 2012 customization work.  The customer is looking for a little bit of help with Service Manager out of the System Center toolset.  Sadly, I don't know anything about what the customer is looking for, just a general statement that they are looking  for customizations.

As I get details of the engagement and the solution that I'll provide, more details will follow.

Sunday, March 11, 2012

Windows 7 Power Management via PowerShell

Recently, I was asked to develop a small script to turn off sleep and hibernate as well as remove the lid closing policy for machines that are using AC Power.  After many attempts to accomplish this in many different ways, I found that the way that works best across different language sets for the Windows Operating System is by using the registry entries for each of the specific entries.  I also wanted to include the ability to change these 3 settings for every power plan on the machine.

Below, you will find the code I am using:

# Stop the machine from going to sleep after 20 minutes.
Write-Host "Removing the automated sleep functionality"
$pwrKey = Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\29f6c1db-86da-48c5-9fdb-f2b67b1f44da\DefaultPowerSchemeValues

ForEach ($pwr in $pwrKey) {
    $Subkey = $pwr.PSChildName
    Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\29f6c1db-86da-48c5-9fdb-f2b67b1f44da\DefaultPowerSchemeValues\$Subkey -Value 0 -Name "ACSettingIndex"
}

# Stop the machine from going into hibernate
Write-Host "Removing the automated hibernate functionality"
$pwrKey = Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\9d7815a6-7ee4-497e-8888-515a05f02364\DefaultPowerSchemeValues

ForEach ($pwr in $pwrKey) {
    $Subkey = $pwr.PSChildName
    Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\9d7815a6-7ee4-497e-8888-515a05f02364\DefaultPowerSchemeValues\$Subkey -Value 0 -Name "ACSettingIndex"
}

# Lid Closing Policy
Write-Host "Removing the Lid Closing Policy"
$pwrKey = Get-ChildItem -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\4f971e89-eebd-4455-a8de-9e59040e7347\5ca83367-6e45-459f-a27b-476b1d01c936\DefaultPowerSchemeValues

ForEach ($pwr in $pwrKey) {
    $Subkey = $pwr.PSChildName
    Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\4f971e89-eebd-4455-a8de-9e59040e7347\5ca83367-6e45-459f-a27b-476b1d01c936\DefaultPowerSchemeValues\$Subkey -Value 0 -Name "ACSettingIndex"
}