Kaseya Community

Setting Power Profile via Agent Procedure

This question is answered

Hello,

I have created a power profile in windows 10 and exported it to a .pow file. I uploaded it to my VSA and then created an agent procedure that should import the profile and set it as active however it does not work. I have tested it from the command line without running in an agent procedure and it works so I know the commands are correct but it just will not stick. Has anyone run into this issue before? I can post the code if needed.

Verified Answer
  • I got it to work. Looks like the .pow file got corrupted on upload to the VSA.

All Replies
  • What method did you use in the procedure?

    I would writeFile to copy the .pow to the local computer, then use executeShellCommand to run the same command that works for me locally, using "Execute as System".

    -   Sometimes, you have to "Execute as System in 64bit shell", depending on your windows version and the command being used.

  • I did use "writeFile" successfully but I haven't tried "Execute As system in a 64bit shell". I will try that.

  • No dice on "Execute as system in 64-bit shell".

  • what is the command you are trying to execute?

  • powercfg /import and powercfg /setactive

  • Are you specifying the full path to the .pow file?

    This is from KLC remote command prompt:

    Note the error in the first line, even though I'm in the c:\temp folder. It worked only when I specified the full path to the .pow file.

    When running a cmd as user SYSTEM, you almost always have to specify the full path to everything. I halfway expected to have to type "c:\windows\system32\powercfg.exe"   lol



    re-uploaded image, initial paste didn't show for me after submitting post
    [edited by: eric at 6:45 AM (GMT -7) on Oct 27, 2020]
  • image doesn't show for me, here is copy/paste from the KLS remote command prompt:

    c:\temp>powercfg /import scheme.pow

    The file could not be found.

    c:\temp>powercfg /import c:\temp\scheme.pow

    Imported Power Scheme Successfully. GUID: 1a1338a3-5ec6-4ce6-8764-73070ce1b787

    c:\temp>

  • I have specified the full path the the file and a GUID to import. I have also tried to specify the full path the powercfg.exe with no luck

  • Here is a picture of my code. I even added the pauses to see if it was just going to quickly but nothing seems to work. 

  • have you tried it without the GUID on the import command ?

  • No, because I would not be able to use /setactive in the next command

  • I got it to work. Looks like the .pow file got corrupted on upload to the VSA.