Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help getting a power scheme logon script running!

Posted on 2008-10-27
8
Medium Priority
?
851 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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

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

Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

885 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