Solved

Convert PowerCFG to VBS XP Windows 2008

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

by Nathan Brom/Bromy2004 Introduction There are numerous websites out there for any different type of program you can imagine.  Of those, you'll need to decide which ones are legitimate and aren't trying to steal your money or infect your comput…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
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…

821 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