Search This Blog

Friday, November 5, 2010

Saving Energy by using Group Policy Preferences

With School District budgets being constantly constrained, we have been looking at different methods of saving money. Having roughly 1800 machines in production, we wanted to be able to shutdown machines at the end of the day and also change their Power Options. We looked at solutions like Faronics PowerSave but that would cost about $12,000. We tried running scripts through our Deployment Solution but that was unpredictable, unreliable, and caused unneeded stress on our server and network. With Group Policy Preferences we were able to accomplish everything we needed quickly for no cost.

Requirements:
1. Active Directory 2003 Environment or better
2. Windows XP SP2 or better clients
3. A Windows 2008, 7, or Vista Machine to run the Group Policy Management Console and create GPOs
4. Client-Side Extensions (CSE) installed on clients - this can be done using WSUS
5. XMLlite installed on clients (Is included on XP SP3, and XP SP2 if you have IE7 or greater installed)
6. Download PsShutdown from SysInternals (http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx)


Steps:
1. Install the CSE's on all clients using WSUS. It is under the 'Updates' classification on the WSUS console. It is referenced as KB943729.

2. Install XMLlite on all clients. If you have SP3 for XP, then you're already covered. If you have SP2 and IE7 or greater, then you're already covered as well. If you have neither of those, update your clients already! You can push IE7 through WSUS if you want to stay on SP2, or you can push SP3 through WSUS.

3. Install the GPMC for your policy-creating machine. Using Windows 7 as an example, you'll have to install the RSAT Tools for Windows 7, then add the GPMC under 'Programs and Features - Turn Windows Features on or off.'

4. While you're at it, you might as well create the Central Store for you Group Policy Templates. You will need to copy your ADMX and ADML files you downloaded above. See this article for creating the Central Store: http://support.microsoft.com/kb/929841.

5. Copy PsShutdown.exe to "\\FQDN\SYSVOL\FQDN\"

6. Open up the GPMC on your Windows 7 machine. Create a new GPO and named it "Shutdown." Right-Click and Edit the Policy Object.

7. Under Computer Configuration > Preferences > Windows Settings > Files go to New - File.
a. For Action choose 'Update.'
b. Under source files, choose the location of PsShutdown.exe from Step 5.
c. For destination file choose 'C:\WINDOWS\psshutdown.exe.'
d. Check 'Suppress errors on individual file actions.'

8. Under Computer Configuration > Preferences > Control Panel Settings > Scheduled Tasks go to New - Scheduled Task.
a. Action: Replace
b. Name: PsShutdown
c. Run: C:\Windows\psshutdown.exe
d. Arguments: -c -t 600 /accepteula (600 refers to number of seconds the user has to cancel shutdown)

9. Schedule Tab
Choose your schedule. Mine is:
a. Scheduled Task: Daily
b. Start Time: 4:45 PM
c. Schedule Task Daily ever 1 day(s)
d. Advanced: Repeat Task every 30 Minutes until 2 hours. Check 'If the task is still running, stop it at this time.' (This means the task will run at 4:45, then every 30 minutes if it is cancelled)

10. Common Tab
a. Check 'Stop processing items in this extension if an error occurs'
b. Check 'Remove this item when it is no longer applied'
c. Check 'Item-level targeting' if you'd like to specify different tasks, at different times. I use this to set up different times for each of our buildings, since they each have different times for releasing children at the end of the day. Each building has its own subnet so I make that task run in only that IP range.

11. Apply the GPO to target OU (Test first!).

12. Within GPMC, create a new GPO called 'Power Management.' Right-Click and choose 'edit.'

13. If your clients are Windows XP, you'll want to make this a User Configuration as XP uses the Power Management settings of the current logged-on user. That user's settings also apply after they log-off. I believe Vista and newer can correctly apply these settings via a Computer Configuration.

14. Under User Configuration > Preferences > Control Panel Settings > Power Options. Right-click and choose New > Power Options (Windows XP). Choose the settings you'd like on your clients. Make note of the green lines. Anything that has a green line under it will be pushed to your clients, and anything with a red line will be ignored. You can use the F5, F6, F7, and F8 buttons to ignore a single setting, ignore all settings, apply a single setting, apply all settings. Play around with it until you know it!

15. Under User Configuration > Preferences > Control Panel Settings > Power Options. Right-click and choose New > Power Scheme (Windows XP)
a. Action: Update
b. Power Schemes - Minimal Power Management. Check 'Make this the active Power Scheme.' This will ensure that, on all CPUs that support it, your processors will "underclock" themselves when the power isn't needed. This is a power saver and will produce less heat.
c. The rest of the settings are up to you! I highly recommend at least instituting Standby if you can but make note that it may or may not affect your ability to wake up your client machines. There is a VBScript I have that'll apply the correct setting to your NICs allowing you to wake them up during Standy/Hibernate states.

16. Apply the GPO to target OU (Test first!).

17. Sit back, watch the results, and bask in the glory that is Group Policy Preferences.

Update:

See this link to learn more on how Power Management settings are applied to Windows XP Workstations.  In essence, your Power Management GPO will need to have 'Loopback Processing with Replace' enabled on the Computer Configuration portion, and then you'll have your Power Settings under your User Configuration portion.  You then apply that GPO to your machines.  It basically enforces those User Settings on the machines and then all users get that setting.  Otherwise, when the computer is restarted it would apply the Power Management settings that were in the .DEFAULT Registry Hive.