Tuesday, April 28, 2015

Create a Zip file on powershell

A script to create a zip file, given a source folder.  Source here:

Friday, April 24, 2015

Using Powershell to log Processor Temperature

I needed to log the temperature of the processor.  I found a Powershell function that could be used, but listed more information than I needed, so I modified it.  The original function can be found here. (new window).  I modified the function to only grab the temperature in Celsius, and added a log to file with Date/Time detail, as well as allow multiple processor sensors to be recorded.
This is also an example of using New-Object and Add-Member
The script can be found on pastebin here. (new window)

Sunday, April 12, 2015

Adobe DC Customisation Wizard

A new version of Adobe Reader is out, with a new name.  No longer called Adobe Reader, it is called Acrobat Reader.  And the version is ‘DC’.

So head on over to Adobe’s website, download and install the Customisation wizard:


Grab Acrobat Reader (without the mcafee / google bundle):


Use your favourite program to extract the files from within the .exe file (WinRAR, 7zip, etc).

Once you have the .MSI file extracted, you can then open the customisation wizard, and open the .MSI using the customisation wizard.

Make any relevant changes you wish to the .MSI file.  EG: ‘Supress display of End User License Agreement (EULA)’, ‘Disable product updates’, ‘Disable Upsell’, etc.

You may also want to use the Registry section of the Customisation Wizard to makes changes, or use Group Policy, or alternate methods of setting the relevant keys:

Don't show messages while viewing a document
HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockdown\cIPM\

Show me messages when I launch Adobe Acrobat Reader DC
HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockdown\cIPM\

Show welcome dialog when opening file
HKLM\SOFTWARE\Policies\Adobe\Acrobat Reader\DC\FeatureLockdown\cWelcomeScreen\

HKLM\Software\Policies\Adobe\Acrobat Reader\DC\FeatureLockDown\

The ‘bDontShowMsgWhenViewingDoc’ as a value of ‘0’ to NOT display the message.  A value of 1 will display the message.  This is the reverse of what is expected given the name is DontShow.

Save the package in the customisation wizard, and install using the following command:
msiexec.exe /i AcroRead.msi TRANSFORMS=acroread.mst

The details for this post were found:


http://www.adobe.com/devnet-docs/acrobatetk/tools/PrefRef/Windows/AVGeneral.html?zoom_highlight=welcome#idkeyname_1_4934 (Some information in this is now incorrect, see the forum post below!)


Thursday, April 9, 2015

Ping Monitor in Powershell

I wanted a basic ping monitor that could be used with Powershell, and found the following:

This function can be Dot Sourced, see my article here.

You will need to unblock the script if you downloaded it, see my article here.

You can set the notification to trigger on ping down (-NotifyOnServerDown), ping up (-NotifyOnServerBackOnline), or both (-NotifyAll).

You can set the timeout on the ping using -sleeptimeout

An example usage would be:
start-monitor -computername QLD_CPS_24 -NotifyAll -smtpserver smtp -tonotification alerts@anonit.net -fromnotification alerts@anonit.net

 You can take a list from a file (1 name / ip per line) using the pipeline:
get-content Monitorlist.txt | start-monitor -NotifyAll -smtpserver smtp -tonotification alerts@anonit.net -fromnotification alerts@anonit.net
 When the script is running, it looks like:

The up / down notifications look like: