forked from jamf/Jamf-Nation-Extension-Attributes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathActive Power Management Profile.xml
25 lines (21 loc) · 1.06 KB
/
Active Power Management Profile.xml
1
<?xml version="1.0" encoding="UTF-8"?><extensionAttribute> <displayName>Active Power Management Profile</displayName> <displayInCategory>Power Management</displayInCategory> <description>This attribute displays the power management profile that is currently active on the machine. This attribute applies to both Mac and Windows.</description> <dataType>string</dataType> <scriptContentsMac>#!/bin/shecho "<result>`/usr/bin/pmset -g 2>&1 | grep \* | awk '{$NF=""; print $0}'`</result>" </scriptContentsMac> <scriptTypeWindows>VBScript</scriptTypeWindows> <scriptContentsWindows>On Error Resume NextDim WshShellDim oExecDim strPowerProfileSet WshShell = WScript.CreateObject("Wscript.Shell")Set oExec = WshShell.Exec("powercfg -GETACTIVESCHEME")strPowerProfile = oExec.StdOut.ReadAllstrPowerProfile = Replace (strPowerProfile, Chr(40), "", 58) strPowerProfile = Replace (strPowerProfile, Chr(41), "")WScript.Echo "<result>" & strPowerProfile & "</result>"</scriptContentsWindows></extensionAttribute>