Pages

Saturday, February 25, 2012

PowerOfTheShell Latest News

27-09-2012
Version 1.3 is now released and can be found in the download section.
It adds support for PC Monitor API 3.0 and Input controls.

Stay tuned for more updates coming soon.

Please report back here or in the forum if you experiance any issues with the plugin.

Cheers


Monday, February 6, 2012

PowerOfTheShell(How To)

Download Zip and extract.
PowerOfTheShell Plugin is very easy to get started with.
Just copy/extract the content of the zip to the destination you want.


Open PC Monitor Manager and add the plugin.






Open plugin config.xml in your favorite editor and create your menu structure.






Short explanation of the XML.
<main> Start Tag
<group> Start the XML with a group before creating all pages and subpages below,


·         title : group name (e.g PowerOfTheShell).


·         enabled: set to True/False shows/hides the whole group.


·         maxResults: limit the amount of results the scripts can return.


<page> A new page,


·         title: page name (e.g Antivirus).


·         pageId: numeric value.(never assign value 0 or the same value twice)


·         subtitle: subtitle text: (e.g Tools for Antivirus).


·         enabled: set to True/False shows/hides the page.


<subpage> A new subpage,


·         title: subpage name (e.g Information).


·         pageId: numeric value.(never assign value 0 or the same value twice)


·         subtitle: subtitle text: (e.g retrieve vendor and status).


·         enabled: set to True/False shows/hides the subpage.


<command> A new command,


·         title: command title (e.g Run script)


·         commandId: numeric value.(never assign value 0 or the same value twice)


·         path: Where your script lies(e.g D:\Scripts\antivirus.ps1)


·         arguments: if your script takes arguments then can be applied here.


</subpage> Closing Subpage
</page> Closing Page


</group> Closing Group
</main> End Tag.

Allow execution of scripts.

Before starting to test the menu and scripts. We need to allow the execution of the scripts.
PowerShell comes default with the ExecutionPolicy: Restricted to allow the plugin to work we need to set the execution policy to RemoteSigned  or Unrestricted(First choice is more secure and recommended)
Open PowerShell, Needs to be elevated because the settings are altered in the Registry.
Run the Get-ExecutionPolicy command to get current setting.
Change the setting by running Set-ExecutionPolicy RemoteSigned, click "y" when promted. The policy is now changed to RemoteSigned.








Simple script Example.
Please note that when running your script(s) in PCM you cannot use cmdlets like write-host or other output formats, this will not work! Instead just list the variable like this.

$info = get-wmiobject -namespace "root/SecurityCenter2" -Query "Select * from AntivirusProduct"
if(($info.productstate -eq 266240) -or ($info.productstate -eq 262144))
{
 $info.displayName
 "Status: OK"
}
else
{
 $info.displayName
 "Status: NOT Updated"
}

Sunday, February 5, 2012

PowerOfTheShell 1.3

This is my first plugin for PC Monitor (PC Monitor By MMSOFT Desgin ltd)

The plugin is all about PowerShell, that’s why I have decided to call it “PowerOfTheShell”

This plugin is for all those of you that want to run PowerShell script while you are on the go and get the results immediately from within PCM directly on your device.
It’s designed towards users like operations, having to run daily scripts or on-duty staff needing to run debug scripts away from their computers.       

Main features are:
  • The menu of PowerOfTheShell including subpages with script commands is easy to configure through an simple layout found in a config XML file.
  • Run any PowerShell script 1.1, 2.0, 3.0 and have the result(s) shown in PCM.
  • Supports WINRM scripts, Execute remote commands on several machines/servers and have the results in one place.
  • Last retrieved results including Date and time is always available while PCM is running.
  • Select max results to be shown. Good if your script returns a lot of results and you want to control amount visible.
  • Information about script status Idle/Running.
  • Configure plugin impersonation settings from within PC Monitor Manager.
  • Support for nested pages.
  • Support for PC Monitor API 3.0 Input Controls.

Hope this can be interesting to some. The possibilities is endless if you can script it ;)
I have already tested and run a lot of my daily scripts I use e.g NTBackup, Antivirus check, Storage info, MSSQL stats, etc etc. Below is some sample pictures.