Solved

Convert PowerCFG to VBS XP Windows 2008

Posted on 2012-03-31
1
693 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
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In a hurry?.. scroll down to "HERE's HOW TO DO IT" Section. Greetings All, I was going to post this as question/solution, but its seems more appropriate as an article considering its length.  I felt it important to illucidate all the details c…
Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now