I pushed a power schedule to a test computer and it all worked - it went into hibernation as expected. I also noticed that if I manually change the power scheme from the Control Panel on the test computer, after an hour or so the LANDesk power schedule is back in place...hmm
Can I remove the LANDesk power schedule so it no longer applies ?? If so, what power scheme will the test computer use ?? Thanks.
Andy A.
I have discovered that any new user that has never loged onto the PC that has the LANDesk PWM Scheme will not have access to the scheme, unless it is re-pushed with LANDesk.
I really would likt to know how to remove the LANDesk PWM Scheme if a user comes to me with a lagitiment buisness reason to have access to there own power settings?
Matt
redeploy the landesk agent!
after that - the power mgmt and launchpad settings will be deleted (also delet the tasks)
greetz
My test failed?
I set up a user account on a computer at my desk. I pushed the LANDesk Power Management policy. This part worked. I re-pushed a scheduled agent deployment and then re-booted the PC. I still get a pop up from Power Policy Manager (Access Denied) for that user. What am I doing wrong?
I do not understand the post that says delete the task? Which task? Maybe that is why it is not working fore me?
Matt
This should be fairly easy to do with the following commands:
C:\program files\landesk\ldclient\localsch /del /taskid=99
C:\windows\system32\powercfg /setactive "Home/Office Desk"
The first line deletes the LANDesk Local Scheduler task that set the LANDesk Power Scheme as the active scheme on a scheduled basis (As set in your LANDesk Power Scheme).
Without removing this local scheduler task, if you change the Windows Power Scheme in the Control Panel, the next time Local Scheduler runs the command "PWMCFG /set" it will set the active Power Scheme back to the "LANDesk PWM Scheme".
The next line uses the Windows Command line utility for viewing/changing/setting Power Scheme options.
You can substitute "Home/Office Desk" for the name of any scheme you want to switch back to. You can see the full list of available schemes in the dropdown for the Power Options Properties "Power schemes" dialog, or you can view it at the command line by running "C:\windows\system32\powercfg /list".
You can also create a new scheme and then change those schemes options. See the PowerCFG /? dialog for further options.
PowerCFG.exe only changes the power scheme for the currently logged in user. So if this is run from a command line when the current user is logged in, it can be used to change the current power scheme. However, if you push this as part of a script or batch file, it will run either as Local System or as the user set in the Scheduler service credentials on the core server. So this would on change the power scheme for that user on the client computer, not for other users.
The C:\Program Files\LANDesk\LDCLIENT\Localsch /del /taskid=99 line is not user specific, this will work globally.
So after running this line, you have several options for running the powercfg /setactive line as the logged in user. Or an alternative to the POWERCFG /setactive line is to use the CF000001 Power Options definition in Patch Manager to set the power policy settings back to how you want them.
You can use the STARTASUSER (http://community.landesk.com/support/docs/DOC-1575) utility to run it in a push job, or as part of a custom definition or batch file, etc.
Or you could create a batch file that does both of these lines, set it to run as a software distribution Policy, set to run at login, and this will run in the users context and set the power options appropriately.
For those of you that want to allow your users to change power options even though they are not administrator, consider adding these lines to a login script:
setacl.exe -on "\\%computername%\HKLM\SOFTWARE\MICROSOFT\Windows\CurrentVersion\Controls Folder\PowerCfg\GlobalPowerPolicy" -ot reg -actn ace -ace "n:%computername%\users;p:full"
setacl.exe -on "\\%computername%\HKLM\SOFTWARE\MICROSOFT\Windows\CurrentVersion\Controls Folder\PowerCfg\PowerPolicies" -ot reg -actn ace -ace "n:%computername%\users;p:full"
setacl.exe -on "\\%computername%\HKLM\SOFTWARE\MICROSOFT\Windows\CurrentVersion\Controls Folder\PowerCfg" -ot reg -actn ace -ace "n:%computername%\users;p:full"
Dave,
Good points. I believe login scripts run under user credentials, so the setacl commands may not work in a locked down environment.
Another method of removing the Local scheduler task for the power policy is with the following command:
C:\Program Files\LANDesk\LDClient\PWMCfg.exe /clear_schedule
However, this only clears the schedule, it does not change the active power Policy to a different power policy.
In the next major release of LDMS there will be an option in the LANDesk Console for removing a power policy.
Let me also explain how LANDesk Power Management Works.
LANDesk clients that have the Power Policy Agent installed have several files in their LDCLIENT directory:
PWMCFG.EXE and PWMScript.ini
NOTE: LANDesk Power Management is an added feature that comes with LDMS 8.8 SP2. However, simply installing the SP2 patch to clients does not added the Power Management Agent and pushing Power Policies to clients that do not have the Power Management Agent installed will result in an error message along the lines of "There was an error launching the task on the client". In order to implement Power Management, you must push an Agent Configuration with the Power Management option checked in the Agents section.
When you create a power policy on the Core Server and then push that policy down to a client, several things take place.
A task is created in the local scheduler to run PWMCFG.EXE /SET. Each hour the Local Scheduler runs PWMCFG /SET which evaluates the contents of PWMScript.ini and then runs the Windows program PowerCFG.EXE (Located in the WINDOWS\SYSTEM32 directory) to create and/or change power policy settings.
The contents of PWMScript.ini look something like this:
Sunday=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
Monday= 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0, 0:3:30 ,0;
Tuesday=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
Wednesday=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
Thursday=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
Friday=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
Saturday=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
In the actual script it is all on one line, but I have moved each day to a seperate line for clarity.
My entry for Monday tells me that I have my Computer set to Hibernate after 30 minutes of inactivity every other hour. (12am, 2 am, 4 am, etc)
Each slot between commas relates to an hour period during the day, starting with 12am and ending at 11pm.
If I had the following settings in a power scheme:
Hibernate | Computer | After 10 Mins | Plugged In | Mon | 8 am
Standby | Computer | After 5 mins | Plugged In | Mon | 8 am
Turn off | Computer | Hard | Mon | 9 am
Turn off | Computer | Soft | Mon | 10 am
Turn off | Monitor | After 1 min | Plugged In | Mon | 8 am
Turn off | Hard Disks | After 3 mins | Plugged In | Mon | 8 am
The resulting line in the PWM file for Monday (as I have set all the events for Monday) would look like this:
Monday=0,0,0,0,0,0,0,0,0: 3 : 10 @0: 2 :5@0: 1 : 1 @0: 5 : 3,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0
Which says at 8am Hibernate the Computer after 10 minutes of activity and (@) Standby the Computer after 5 Minutes of inactivity and (@) Turn off the Monitor after 1 minute of inactivity, and Turn off the Hard Disks after 3 minutes of activity.
So the following values specify the device and action:
1 - Monitor : Turn Off
2 - Computer : Standby
3 - Computer : Hibernate
4 - Computer : Hard Turn Off
5 - Hard Disks : Turn Off
6 - Computer : Soft Turn Off
These options use the POWERCFG.EXE standard Windows Utility to change the LANDesk PWM Scheme to reflect the current hours settings. This is the real intrinsic value of the LANDesk Power Management feature to add Chronological Variability to the Power Schemes.
NOTE: This is set for the currently logged in user. If you log off of the current user and in with another user, the power settings will not change for that user until the next allotted time hits and the local scheduler applies the LANDesk PWM Scheme.
At 9 am (the number 4) do a hard shutdown of the computer.
At 10 am do a soft (the number 6) shutdown of the computer.
If the PWMCFG utility sees the number 4 in the spot for the current hour it will spawn the LANDesk Shutdown Utility (poweroff.exe located in C:\Windows\System32) with a 30 second countdown with the option to cancel. If the countdown expires, it shuts the computer off without closing any programs, etc. This is a hard shutdown.
If the PWMCFG utility sees the number 6 in the spot for the current hour it will spawn the Windows utility "shutdown.exe". This is the same as if you went to the Start Menu and chose "Shutdown". If there are open programs it will prompt to save. If there are other users logged into the computer it will warn that others users are logged in, etc.
For schemes that include a "Turn On" option, a separate task is created on the core server and a Wake On LAN Packet is sent to the computer at the designated time. This is controlled purely on the Core Server side and there are no files or settings sent to the client.
Another Tip: In the Power Savings report, at times you may notice that it reports negative values.
The reason this may happen is that the current power settings for the computer(s) in the target query are gathered and stored in the Inventory. We do not compare your Power Policy settings with an arbitrary number. We compare the Power Policy settings you intend to push to the client to the current Power Policy in place on the computer. If for example you set your Power Policy to simply turn off the Monitor and Hard Disks after X amount of minutes, but the existing policy in place on the computer (Windows policy or LANDesk policy, either way) puts the computer into Hibernate or Standby, that would save more power than the Monitor and Hard disks.
The power policy settings are stored in the Inventory under "Power Management". If you have an existing LANDesk Power policy you will see " Last Deployed Date " and " Last Deployed Policy ". Along with the current settings. If the system has never had a LANDesk Power Policy deployed, you will simply see the current policy settings. In either instance you will see what the current settings are as follows:
System Hibernate AC
System Hibernate DC
System standby AC
System standby DC
Turn off hard disk AC
Turn off hard disk DC
Turn off Monitor AC
Turn off Monitor DC
Very cool. One of our customers was asking this. Thanks Dave.
Leon
Thanks, this is very valuable information. My LD Power Scheme continues to reappear after being removed.
I created a policy supported push for my BAT file and tried it as local system, current user, and simply ran
the BAT file locally as the user. It successfully rolled the policy to Home/Office on XP and High Performance on Vista.
However, the settings revert back to LANDesk power scheme when users return in the morning.
Here are the scripts I ran:
XP
@echo off
REM - XP Power Managment Rollback
C:\program files\landesk\ldclient\localsch /del /taskid=99
C:\Program Files\LANDesk\LDClient\PWMCfg.exe /clear_schedule
C:\windows\system32\powercfg /setactive "Home/Office Desk"
Vista
@echo off
REM - Vista Power Management Rollback
C:\program files\landesk\ldclient\localsch /del /taskid=99
C:\Program Files\LANDesk\LDClient\PWMCfg.exe /clear_schedule
C:\windows\system32\powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
rem settings for balanced C:\windows\system32\powercfg /s 381b4222-f694-41f0-9685-ff5bb260df2e
My LANDesk Policy Policy task is still listed in my scheduled task, but I dont have any machines targeted.
Any help would be greatly appreciated. This is affecting many of our computers.
Thanks!
Has anyone put PWMCFG /SET in your login script by chance?
I just looked at our login scripts and Group policy to make sure.
I see no mention of pwrcfg in our scripts and no power mgmt settings
applied via GP.
Another alternative would be to create another pm policy with an arbitrary setting, such as turn off monitor or hard disks never, and then deploy that policy. This overwrites any existing pm policy. Unless you want to switch the active scheme from LANDesk to one of the Windows schemes for some reason, this might be a possibility for you.
| ||||||
