2016-10-18

My HTPC has/had a CIR which allowed me to turn it on via my Harmony remote, but one day it stopped working and my attempts to fix it totally broke it.
So my 1st idea was I'll buy a new CIR device, but I couldn't find any.My 2nd idea was get a new Motherboard, but that meant new CPU (Skylake i7-6700k) + RAM (DDR4) bcos there's no point getting a new Mobo if your not getting the latest and greatest, and I couldn't find any which turned on via IR.My 3rd idea was build something :), this turned out to be ridiculously easy.What would I need? Some way of automating pressing the button for 2 seconds, bcos that turns the PC on and off, and something to accept an IR signal.I knew ATX PSU's have a 5v standby power supply, so IR relay would need to operate on 5v.

A quick google didn't help, so I went to Alibaba and found exactly what I was looking for, a 5v IR relay with timer function. I then went to eBay bcos I prefer the buying experience.
Programmable Timer Relay Module + IR Remote Controller for $5 how awesome is that!?
3 weeks later it arrives and I proceed to install it. Please excuse the poor drawing, I don't have Visio installed on this PC.

Steps:

Test relay to ensure it works.

Program your universal IR remote unless you want to use the included one. My Harmony Elite had a really hard time learning the IR command, and even when it did it wouldn't work the 1st time, but it eventually learnt the command.

Set relay time to 2 seconds, shorter will turn it on, but may not turn it off. 4 seconds will force a power cut.

If required extend the infrared phototransistor, black shiny thing with 3 pins. I extended mine by 30cm to have it sit outside the case.

Either find 5v on a motherboard pin header (there's bound to be a couple) or get it directly from the ATX connector.

5v in to the IR relay power input.

Run 2 wires from relay output NO + COM to the Power Switch pins on your motherboard.

T join the case front panel power switch to the Power Switch pins on your motherboard so you can still use the normal power switch.

Test. Apart from the Harmony learning command issue, it has worked flawlessly for the past 2 weeks and I like that it turns off instead of the Alt+F4 I used to do. I even use an Amazon Echo + Harmony + Yonomi to voice control it with; Alexa, turn PC on/off.

2016-09-27

Some of us can't stand iOS but there's no denying it's the primary mobile platform and it has a SharePoint. Microsoft's just released an early access version of the Andoird app on the Play Store.
The SharePoint app includes all the things you'd expect to find - managing team sites, document storage, Office 365 integration, and collaboration features with other team members. Documents can be edited with the Office Mobile apps (Word, Excel, PowerPoint, and OneNote), making for easy updating on your Android phone or tablet. The app is powered by Microsoft Graph, which "makes it faster to get to content and people you work with".

2016-06-30

This function is intended to reside within the logic of a larger script for deploying an entire resource group. The function should ideally be fed from a JSON or XML configuration file.
It takes a whole bunch of inputs relating to Azure VMs and provisions a VM within a resource group and VNet with a public IP. The Network Security Group settings need to be amended as required.
I've extracted some of the required variables, but these could also be passed as parameters.

2016-01-10

Very useful if you're updating taxonomy fields.Takes 3 inputs; the Site URL, the Taxonomy field object and the Term string.The function gets a reference to the site's term store and then executes the GetTerm method, (more info here: TermSet.GetTerms) and finally return a Term object.

functionGetTerm([string]$siteUrl,[Microsoft.SharePoint.Taxonomy.TaxonomyField]$oField,[string]$termStr){if(!$oField.IsTermSetValid){Write-Host"[ERROR] $($oField.Title) IsTermSetValid is FALSE"return$null;}$taxonomySession=Get-SPTaxonomySession-Site$siteUrl;if(($taxonomySession-eq$null)-or($taxonomySession-eq$null)){Write-Host"[ERROR] Taxonomy Session is null, Metadata Service App Proxy default storage location for column specific term sets is CHECKED and the user account has access"return$null}$oTermStore=$taxonomySession.DefaultSiteCollectionTermStore;if($oTermStore-eq$null){$oTermStore=$taxonomySession.TermStores[0];}if($oTermStore-eq$null){Write-Host"[ERROR] Unable to get a valid Term Store.`nEnsure $(whoami) is a Term Store administrator.`nEnsure the Managed Metadata Service Proxy property 'This service application is the default storage location for column specific term sets.' is checked."Redexit}$oTermSet=$oTermStore.GetTermSet($oField.TermSetId);[System.Guid]$gTermId=$oField.AnchorId;[int]$LCID=1033;if(($gTermId.ToString()-eq"00000000-0000-0000-0000-000000000000")-or($gTermId-eq$null)){$oTerm=$oTermSet.GetTerms($termStr,$LCID,$true)[0];if($oTerm-eq$null){Write-Host"[ERROR] Term value: $termStr not found in TermSet $($oTermSet.Name)"Red}}else{$oAnchorTerm=$oTermSet.GetTerm($gTermId);$oTerm=$oAnchorTerm.Terms[$termStr];if($oTerm-eq$null){Write-Host"[ERROR] Term value: $termStr not found in $($oTermSet.Name);$($oAnchorTerm.GetPath())"Red}}return$oTerm}

Below is an example of how to use the function and the returned Term object to set the default value for a field.

2014-10-12

While ostensibly simple the process to copy allowed content types and welcome page properties took a while to figure out.
The function takes 2 input; the source Content Type (CT) for the Document Set (DS), and the target CT for the DS. It assumes both have been created and referenced.It then gets a reference to the source DS Template, and loops through its properties to copy them to the target CT.There are a couple of 2 second sleeps in there bcos in the environment where I was using it sometimes the re-referencing wouldn't work without them.

2014-09-12

The function accepts 4 paramters the Site Url, the Library name where the Document Set will be created, the Content Type of the Document Set and finally the Name of the Document Set.
To set properties for the Document Set, and simple modification would be to include a key pair Hash table, the function declares an empty one ($dsProps) Example would be:
[hashtable] $dsProps = @{"Key" = "Value";"Key" = "Value";}or$dsProps["Key"]="Value" $dsProps["Key"]="Value"
The function: