Solved

Help getting a power scheme logon script running!

Posted on 2008-10-27
8
843 Views
Last Modified: 2012-05-05
I have tried and tried to get a power scheme script to work.  I can't even seem to get a logon  script to run at all.  

this is a sample batch file that i have changed but to no avail:

@echo off
net use x: \\doman_DNS_name\netlogon

x:
powercfg.exe /change "always on" /monitor-timeout-ac 20
powercfg.exe /SETACTIVE "always on"
c:
net use x: /delete

I am relatively new at working with active directory but I believe I have a pretty good understanding of how it works.  I created OU with the group and users that I wanted the script to run on and linked the GPO to it.  Didn't work.  Also tried just using the Script path to no success either.  So I am not really sure if something is wrong with the batch file or if something is not set in AD to allow the script to run.  I am at a loss and need help.  Thank you in advance
0
Comment
Question by:geleman
[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
  • 4
  • 3
8 Comments
 
LVL 31

Expert Comment

by:Justin Owens
ID: 22816310
First, I am not sure why you are mapping X: to your DC.  powercfg is builtin to Windows and in the path.  You can run it from C:\.  Next, you may want to turn the echo back on so you can see if there are any error messages.  I cannot see a fault in the two lines that actually invoke the changes you want.  How are you telling GP to run your script and how are you verifying that it is not running?
0
 
LVL 59

Expert Comment

by:Darius Ghassem
ID: 22816435
0
 

Author Comment

by:geleman
ID: 22816828
Dr. Ultima,
The X: from the place I got the sample from.  I have modified it a few different ways and it still didn't work.
As far verifying it running i set it up so it could be visible on the logon and I also did a report and it doesn't give a time it has ever run.  So I am not sure what I am doing wrong.  I have a few variations of the script that I ran if you would like to see those.  Other than that I tried it both was as far as running in via the Profile tab in the user file and the GPO.  This the link for which I found out how somebody did it via GPO.

http://lawrencepatterson.com/?p=3

I have actually found two other was to allow the user to adjust the power schemes one being how dariusq suggested and another is adding keys and granting permission on those keys in the default GPO.  I would just much rather figure out how to get it working through it's own GPO if possible.  Appreciate the quick responses.
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 31

Expert Comment

by:Justin Owens
ID: 22816993
One of the issues you may be facing is permissions.  To change the power settings in Windows XP, you need power user or admin access (or explicit change access to the referenced registry keys).  The page you referenced is for Windows XP, so that is what I assume you are running.  I am not sure your script will work if admin rights don't exist.
Honestly, dariusq's suggestion to use the Energy Star scheme is probably the easier solution.
0
 

Author Comment

by:geleman
ID: 22817194
I did go through and grant the permissions on the registry keys.  Pretty sure it was part of the article that I referenced.  I enabled full control in the edit of the GPO when I set it up.  The current solution I have set is enabling full control in the Domain Security Policy and it seems to work so I am pretty sure I have the permissions set right when I do the GPO.  I'm really thinking that it has something to do with the batch file that I am running but I am not sure.  I really want to try to not to have to install the enery star because it requires a client.  If I can't get the GPO to work right then I'll stick with the edit I did, but I'm hard headed and like to see things work.  Here is one variation of the batch that I used.

@echo off
net use  c: \\doman_DNS_name\netlogon

powercfg.exe /change "always on" /monitor-timeout-ac 20
powercfg.exe /SETACTIVE "always on"

net use c: /delete

and

@echo off
net use  \\doman_DNS_name\netlogon

powercfg.exe /change "always on" /monitor-timeout-ac 20
powercfg.exe /SETACTIVE "always on"

net use  /delete


The thing that really confuses me about the article is it says to put a copy of powercfg.exe to the netlogon.  Shouldn't it be able to reference the system root where it is originally located?
0
 

Author Comment

by:geleman
ID: 22817213
Also I have ran the batch file:

cd\

powercfg /change "always on" /monitor-timeout-ac 20
powercfg /setactive "always on'

/delete

locally and it worked fine

0
 
LVL 31

Accepted Solution

by:
Justin Owens earned 500 total points
ID: 22817420
Something to consider.  It is a bad idea to program specific usernames into a GPO... Rather than using a specific name, choose "Authenticated Users" when adding those two registry key.  Also, remember that before you click OK twice, that Autenticated Users needs to have Full Control.  Default is Read Only.  
I think your batch file is OK as originally posted, I still think it is a permission issues within the registry.  After making this change, log off and back on twice to see if the changes were propogated correctly on your test machine.
0
 

Author Closing Comment

by:geleman
ID: 31510489
The batch file never worked so I went with just add registry keys in the Default Domain GPO and edited them so that the users could have access to their power configurations.  I am not sure why the batch wouldn't work but this way works just fine the batch would just automatically set it for them, instead of setting it themselves.  Thanks for the help.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

739 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