PowerShell and Power Options

There are many useful tools that offer to Systems Administrator to set up network devices with the desired configuration starting from Group Policy to MS ConfigMgr / System Center Configuration Manager(SCCM) .

What PowerShell is bringing to the table is flexibility to check if everything is working as expected in few lines of code and even to correct issues quickly.

Imagine to check if power option settings are applied correctly to every windows os according to the configuration for the Standard Operating Environment (SOE).

This script will help us to get the power options of a remote host.

This one will set remotely the power options on the target system to High Performance.

In these scripts WinRM will be started remotely if the service is not running and than stopped. Remove this line if you want to leave it running:

There are many cmdlets that accept ComputerName as argument can perform remote actions without WinRM service running e.g:

  • Get-Process
  • Get-Service
  • Get-EventLog
  • Stop-Computer
  • Restart-Computer
  • etc.

2 Replies to “PowerShell and Power Options”

    1. Hi Hank,
      Thanks for your comment.

      These scripts define a couple of functions, once imported with the dot sourcing and following the instructions they should perform as expected following the examples. I can confirm that these scripts were tested on Win 10, feel free to reach out to me writing a DM attaching your error output.

      Please note that I should have added #requires -runasadministrator as the first line because to apply these changes it’s required to have high privileges on the endpoint.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.