Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Convert PowerCFG to VBS XP Windows 2008

Posted on 2012-03-31
1
Medium Priority
?
718 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
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…

610 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