Solved

Convert PowerCFG to VBS XP Windows 2008

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
GPO - Set RDP access for specific OU Admin only 4 25
SCCM 2012 14 31
prepare AD for 2012 R2 6 99
Windows 10 home to Pro 25 73
The way I use Experts Exchange to assist me in analyzing and diagnosing a problem is I first enter a Verbose Question at Experts Exchange like: Office 2007 will hang when opening and saving files I then launch WordPad (any text editor will do) an…
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
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…
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…

911 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

23 Experts available now in Live!

Get 1:1 Help Now