Monthly Archives: April 2015

Setup Powershell Remoting … Remotely

You can use Sysinternals psexec to setup powershell remoting … remotely.

Get psexec.exe from here: https://technet.microsoft.com/en-gb/sysinternals/bb897553 

The command to install it is:

psexec \%PCNAME% -h c:windowssystem32winrm.cmd quickconfig –quiet

Where %PCNAME% is the name of the PC you wish to install it on.

eg:
psexec \WA_P_023 –h:windowssystem32winrm.cmd quickconfig -quiet

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)

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:

http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=5892&fileID=5928

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

http://get.adobe.com/reader/enterprise/

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
HKLMSOFTWAREPoliciesAdobeAcrobat ReaderDCFeatureLockdowncIPM
bDontShowMsgWhenViewingDoc
Reg_DWORD
0

Show me messages when I launch Adobe Acrobat Reader DC
HKLMSOFTWAREPoliciesAdobeAcrobat ReaderDCFeatureLockdowncIPM
bShowMsgAtLaunch
Reg_DWORD
0

Show welcome dialog when opening file
HKLMSOFTWAREPoliciesAdobeAcrobat ReaderDCFeatureLockdowncWelcomeScreen
bShowWelcomeScreen
Reg_DWORD
0

HKLMSoftwarePoliciesAdobeAcrobat ReaderDCFeatureLockDown
bUsageMeasurement
Reg_DWORD
0

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://anonit.blogspot.com.au/2010/09/adobe-reader.html

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!)

https://forums.adobe.com/thread/1812870

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: