Managing Power Savings for XP via GPO

You can manage the power savings features of both Windows XP and Vista using a GPO in a domain environment. In order to do this you will need to get Group Policy Preference Client Side Extensions for Windows XP (KB943729). You can download this extension via the following URL:

http://www.microsoft.com/downloads/details.aspx?FamilyID=e60b5c8f-d7dc-4b27-a261-247ce3f6c4f8&DisplayLang=en

The preferences are already available if you are working with Windows Vista or 7, so the previous download would not be needed for these. You should also be using the Group Policy Management tool which is available as part of the RSAT for Windows Vista and Windows 7, or the Administrative Tools for Windows Server 2003 on XP. These can be downloaded from the following URLs:

Windows XP

http://www.microsoft.com/downloads/details.aspx?FamilyID=e487f885-f0c7-436a-a392-25793a25bad7&DisplayLang=en

Windows Vista

http://www.microsoft.com/downloads/details.aspx?FamilyId=9FF6E897-23CE-4A36-B7FC-D52065DE9960&displaylang=en

Windows 7

http://www.microsoft.com/downloads/details.aspx?familyid=7D2F6AD7-656B-4313-A005-4E344E43997D&displaylang=en

These policies work best against an OU of computers. Depending on how your domain is structured you may need to create an OU for the computers you want to manage Power Savings for, as you cannot apply a GPO to the Computers container. If you already have defined an OU structure for your computers, you should create this as a separate GPO so you can link it to more than one place, and still only need to update one Policy.

I won’t go in to detail on how to create Group Policies or how they are applied; you can find that information on the Technet site at Microsoft.com.

Open up the Group Policy Management Console and create a GPO for Power Management (fig 1.)

fig1

Next you will need to edit your newly created GPO. The Power Management settings can be found in both Computer Configuration and User Configuration (fig 2.). Most of the settings that you would be interested in can be found under Computer ConfigurationPreferencesControl Panel SettingsPower Options. You can see that it is in a similar location for User Configuration.

fig2

Right click and from the popup menu chose either New > Power Options (Windows XP) or New > Power Scheme (Windows XP) (fig 3.). There is also an option to configure a Windows Vista Power Plan. I think of most interest to the average Admin is the Power Scheme. This allows you to define what to turn on or off and when to go to standby.

fig3

This should look very familiar if you have ever configured the power settings in Windows XP before, the only difference would be the actions drop down at the top of the screen, and the Common tab which is related to the GPO itself. I will not go in to the settings found under the Common tab, but needless to say if you wanted to target a specific computer or group of computers you can do it there.

The following table lists what each of the options in the Action drop down do.

Create Create a newly configured Power Scheme. If a power scheme with the same name as the Power Scheme item exists, then the existing Power Scheme is not modified.
Delete Remove a Power Scheme with the same name as the Power Scheme preference item. The extension performs no action if the Power Scheme does not exist.
Replace Delete and recreate the named power scheme. The net result of the Replace action overwrites all existing settings associated with the power scheme. If the power scheme does not exist, then the Replace action creates a newly configured power scheme.
Update Modify a power scheme. The action differs from Replace in that it updates the settings defined within the preference item. All other settings remain as they were previously configured. If the power scheme does not exist, then the Update action creates a new power scheme.

I would like to pass along what I have found regarding defining preferences. This is a relatively new feature for Group Policy what we have found during testing is that these settings tattoo the registry and don’t always get cleanly removed like regular GPO’s do. As always something like this should be tested fully before deployed into production following your own internal roll out procedures.

Below is a list of references for your own edification.

Group Policy on TechNet

http://technet.microsoft.com/en-us/library/cc754286.aspx

Group Policy New Features

http://technet.microsoft.com/en-us/library/cc725828(WS.10).aspx

Document describing Group Policy Preferences and Deployment practices

http://www.microsoft.com/downloads/details.aspx?FamilyID=42e30e3f-6f01-4610-9d6e-f6e0fb7a0790&DisplayLang=en

Group Policy Survival Guide

http://www.microsoft.com/downloads/details.aspx?familyid=66643D52-BD3D-4B10-972C-316ECA5DBEDF&displaylang=en

Various PHP related messages

ntwdblib.dll: This application has failed to start because ntwdblib.dll was not found. Re-install the application may fix this problem

Resolved:
Comment out the following lines from php.ini
[PHP_MSSQL]
extension=php_mssql.dll
[PHP_PDO_MSSQL]
extension=php_pdo_mssql.dll

OCI.dll: This application has failed to start because OCI.dll was not found. Re-install the application may fix this problem

Resolved:
Comment out the following lines from php.ini
[PHP_OCI8]
extension=php_oci8.dll
[PHP_PDO_OCI]
extension=php_pdo_oci.dll
[PHP_PDO_OCI8]
extension=php_pdo_oci8.dll

LIBPQ.dll: This application has failed to start because LIBPQ.dll was not found. Re-install the application may fix this problem

Resolved:
Comment out the following lines from php.ini
[PHP_PDO_PGSQL]
extension=php_pdo_pgsql.dll
[PHP_PGSQL]
extension=php_pgsql.dll

sqlite3.dll: This application has failed to start because sqlite3.dll was not found. Re-install the application may fix this problem

Resolved:
Comment out the following lines from php.ini
[PHP_PDO_SQLITE_EXTERNAL]
extension=php_pdo_sqlite_external.dll

aspell-15.dll: This application has failed to start because aspell-15.dll was not found. Re-install the application may fix this problem

Resolved:
Comment out the following lines from php.ini
[PHP_PSPELL]
extension=php_pspell.dll

libcs.dll: This application has failed to start because libcs.dll was not found. Re-install the application may fix this problem

Resolved:
Comment out the following lines from php.ini
[PHP_SYBASE_CT]
extension=php_sybase_ct.dll

Manual installation of IIS, PHP and MySQL

Last week I posted an article about how I configured IIS, PHP and MySQL using Microsoft’s Web PI 2.0 technology, which was wicked easy. Today I figured I would run the same thing but this time “manually”. Which if I had to rank things in order of difficulty from 1 to 5, where one is the easiest, the Web PI install would be a one, and the manual install would be a two. There are a few things you will need to download the links are below.

Windows

Setup your server in whatever way suits you best, make sure that you install the Application Server role, I chose to not check the ASP.NET and Frontpage extensions, but that’s my personal preference. Depending on how you setup your server you may or may not be asked to insert the media.

FastCGI and PHP

You should download and install FastCGI first, just take all the defaults. Once you have that configured you will need to download and install PHP, I’ve been sticking with version 5.2 but you can grab the most recent if you like. PHP will configure FastCGI for you if you install it first. If you do the FastCGI after the fact you may have some configuration you will need to do manually.

MySQL

Again just take the defaults depending on which version fo MySQL you downloaded, I did not choose the Windows Essentials build, I chose the larger installer option. During setup I selected to install the complete package. Once the installation is complete you will want to choose the Configure option as this allows you to setup your root account on the server.

I used the Standard Configuration option, chose to install it as a service and launch automatically. The following screen is where you define the password for root, set this as secure as you need it. I did not select to make the account available from remote machines, you may want to note this password unless you have a standard admin password that you use as future configurations will require it.

Click execute and you’re done.

At this point everything is done the next thing we’ll need to do is tackle any error messages that show up. I have already documented one regarding msvcrt7.dll, I have noticed that on my test machine I have other messages which I will document later tonight or tomorrow.

PHP, Pear and Windows

When running PHP I receive the following message:

“This application has failed to start because MSVCR71.dll was not found. Re-installing the application may fix this problem.”

This file is available on your system, it is part of the .net 1.1 installation and you can find it in the appropriate folder. What I’m guessing at is that when PHP was compiled this file was linked directly in and on the machine doing the compiling it was located in the system32 directory. I tried several things to make it go.

  1. Download and attempt installation of .net 1.1: FAILED
  2. Attempting to use REGSVR32.exe to register the file: FAILED

What appeared to make the error go away was much simpler, I copied the file from it’s location in the .net 1.1 folder structure to the system32 directory and I’ve not seen the error. Below is the command line that I used to make it work.

copy C:WINDOWSMicrosoft.NETFrameworkv1.1.4322MSVCR7.dll C:WindowsSystem32

I do know that the lack of the file does not appear to cause any problems with PHP at all. PHP pages load perfectly fine, running PHP scripts from the command line also work fine.

The Web PI installation of PHP lacks several extensions that may be necessary based on your needs, so in order to get the needed packages you will need to use the Pear package manager. In addition to lacking many extensions, the Web PI install of PHP also lacks Pear, fortunately this is very easy to get.

I opened the Pear manual and in the section under installation found that all you need to do is download the go-pear.php file and run it. Follow the prompts and answer the questions, on my base installation it detected everything properly and was able to install and configure itself with no problems.

IIS, PHP, MySQL and Web PI

I’ve posted a couple of things last week regarding how I use Virtual PC, and since recently I’ve been downloading web apps that need php and mysql I figured I would document what I did to make them go. One of the things I figured out very early on is my job is to find things to make us go, yes I stole that from a Star Trek episode but it’s so true!

So when I make new test servers I follow the steps outlined in this post first.

There are several ways to configure PHP and MySQL I’ll outline a couple the first would be the super easy installation which seems to get a functional install up and running quite quickly.

Web Platform Installer 2.0:

  1. If you don’t already have Web PI get it here.
  2. Once installed, launch the Installer from the Start menu
  3. Configure Web PI to see what we need

    1. Click “Options” select “Developer Tools”

  4. Next select the following components from “Web Platform”

    1. Web Server: “IIS 6.0”, “Fast CGI” and “URLScan 3.1”
    2. Frameworks: “PHP 5.2.11”

Getting mySQL to show up is a little tricky, you will need to select a web app that depends on a database, the easy option is Acquia Drupal. This will get everything up and running as well as having a highly customizable Content Management system. Once you select Acquia Drupal click Install and review your options, you will see the MySQL Windows Essential option is selected, you could at this point click the “X” next to Drupal and be done with it. Choose accept to get the process started and depending on your connection speed you should be done within 30 minutes. You will be prompted for to configure the root password for MySQL.

Once everything is complete you may want to flesh out your PHP installation, by downloading pear. I noticed that there are only a handful of extensions loaded with the Web PI version of PHP. Below is the list of extensions that are available to you when complete:

 

[PHP_CURL]
extension=php_curl.dll
[PHP_GD2]
extension=php_gd2.dll
[PHP_GETTEXT]
extension=php_gettext.dll
[PHP_IMAP]
extension=php_imap.dll
[PHP_MBSTRING]
extension=php_mbstring.dll
[PHP_MSSQL]
extension=php_mssql.dll
[PHP_MYSQL]
extension=php_mysql.dll
[PHP_MYSQLI]
extension=php_mysqli.dll
[PHP_OPENSSL]
extension=php_openssl.dll
[PHP_PDO]
extension=php_pdo.dll
[PHP_PDO_MYSQL]
extension=php_pdo_mysql.dll
[PHP_PDO_SQLITE]
extension=php_pdo_sqlite.dll
[PHP_SOAP]
extension=php_soap.dll
[PHP_TIDY]
extension=php_tidy.dll
[PHP_XMLRPC]
extension=php_xmlrpc.dll
[PHP_ZIP]
extension=php_zip.dll
[PHP_EXIF]
extension=php_exif.dll

Building Servers

Building a server, using the method I outlined in my previous post, becomes cake.

Building a server:

  1. Create a new virtual machine, use the default option
  2. Configure the settings for your new VM
  3. Run the New Virtual Disk wizard

    1. New virtual disk
    2. New Hard Disk
    3. Browse to the folder where your VM is stored
    4. Choose differencing disk
    5. Browse to the folder where the Server Base Image VHD is located

  4. Add the disk to your VM, make sure to browse to the proper VHD
  5. Power on the VM

Depending on how long ago the base image was created you may wish to check the OS for any security updates to make sure you’re as patched as possible.

Windows/Linux Server Base Image

I do a lot of software evaluations and as such I have come to rely quite heavily on virtualzation so I don’t have to worry about setting up hardware. As the software that we evaluate can be either Windows or Linux based I have created two base images, and from there build out my test servers for software deployment. The steps for each OS are very similar and I won’t go into any great detail on specific setup steps. I tend to just do a basic Windows Server installation taking all the defaults, and likewise for my Ubuntu LTS installation with only exception being selecting the OpenSSH at the end.

My personal choice for virtualization software is Virtual PC, mainly because I have used it ever since it became available for Windows and I don’t need anything more complicated to evaluate software.

Virtual PC Settings:

  • Networking: Shared NAT
  • Memory: 512MB
  • Hard Disk 1: 40GB
  • Floppy: Disabled
  • Sound: Disabled
  • Hardware Virtualization: Enabled

I have .iso images of my server install disks, so I just boot the blank base vm from iso and run setup from there.

Windows Server Installation:

  • Default WIndows Server installation
  • Apply the most recent service pack
  • Install .net 2 & 3
  • Connect to Windows Update (critical and software)
  • Repeat until all updates applied
  • Copy the i386 folder from the cd to drive C:
  • Extract supptools.cab to C:Support
  • Run the Setup Manager and choose a sysprep install
  • Sysprep the server and shut down

Ubuntu LTS Installation:

  • F6 and add noreplace-paravirt
  • Default installation
  • Choose OpenSSH at the end
  • SSH into server modify menu.lst add vga=771 noreplace-paravirt
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo shutdown -h now

I’m not sure if there is something similar for sysprep in Linux, but I’m pretty sure that it doesn’t really matter as you can just edit files in /etc and you’re done.

That’s pretty much all I do, the fun stuff is when I create a new machine based off this one.