Solved

Convert PowerCFG to VBS XP Windows 2008

Posted on 2012-03-31
1
704 Views
Last Modified: 2012-04-03
Hello experts

We have tried setting the power management setting via group policy but this seems to fail

Our network is made up of Windows 2008 DCs and XP SP3 Clients

I have tested the below script on my test lab in DOS and it works like a treat

net use i: \\dc1\netlogon
i:
powercfg.exe /change "always on" /monitor-timeout-ac 15
powercfg.exe /change "always on" /standby-timeout-ac 0
powercfg.exe /SETACTIVE "always on"

C:\

net use i: /delete

Lucky our main login script is in VBS could any of you experts convert this into VBS or provide any GPO knowledge on power management


Cheers
0
Comment
Question by:it_ops
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
Scottyworld earned 500 total points
ID: 37794273
Hi,
There's several ways you can achieve this, in various jobs I have implemented each of them.
1) Add a couple of lines into your logon script that run these 'DOS' commands - this obviously forces the settings at every logon.

2) create a power policy(on a standard XP PC) and export it as a .pow file, then use a GPO startup/logon script to distribute it to all PCs and make it the active policy. This allows people to change their policy afterwards, and not have it revert every time they logon

3) Use Terra Novum's GPO Power manager tool. (www.terranovum.com/projects/energystar/ez_gpo.php), although this will first need a client install before it will read the GPO adm that they supply. We built the client software into our deployment image.
This allows easier global management, and you can create different settings for different departments.

The below code will cover option 1 for you
Set oShell = CreateObject("Wscript.Shell")
strProfile = "always on"
strExeCommand1 = "powercfg.exe /change " & Chr(34) & strProfile & Chr(34) & " /monitor-timeout-ac 15"
strExeCommand2 = "powercfg.exe /change " & Chr(34) & strProfile & Chr(34) & " /monitor-timeout-ac 15"
strExeCommand3 = "powercfg.exe /SETACTIVE " & Chr(34) & strProfile & Chr(34)

oShell.Run "cmd.exe /c " & Chr(34) & strExeCommand1 & chr(34) & Chr(32) ,1,True
oShell.Run "cmd.exe /c " & Chr(34) & strExeCommand2 & chr(34) & Chr(32) ,1,True
oShell.Run "cmd.exe /c " & Chr(34) & strExeCommand3 & chr(34) & Chr(32) ,1,True

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article covers how to install the Microsoft Windows Operating System (OS). What is covered in this article:  > Different Versions and Editions of the Windows OS  > Upgrading versus Fresh Installation of the OS           - Steps to take pr…
The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question