Author Archives: richardsiddaway

Output from jobs

I tripped over a little problem the other day that’s worth reporting.  I was running something like this:   $sb = {$procs = get-service$procs | Export-Csv test.csv -NoTypeInformation} Start-Job -ScriptBlock $sb -Name test   I was collecting some data and … Continue reading

Posted in Powershell Basics | Leave a comment

Multiple triggers on a scheduled task

Setting up a scheduled task can be accomplished like this:   $taskname = ‘Test Job’ Get-ScheduledTask -TaskName $taskname -ErrorAction SilentlyContinue |  Unregister-ScheduledTask -Confirm:$false   $trigger = New-ScheduledTaskTrigger -Daily -At 03:00   $actionscript = ‘-NoExit -NonInteractive -NoProfile -WindowStyle Normal -NoLogo -Command … Continue reading

Posted in Powershell | Leave a comment

OneNote and XML–finding pages

Pages are towards the bottom of the hierarchy in OneNote – though we still haven’t dived into the content of pages yet.   You can find the pages in your notebooks like this:   $onenote = New-Object -ComObject OneNote.Application$scope = … Continue reading

Posted in Office 2013, Powershell | Leave a comment

OneNote and XML–finding sections

I recently showed how to find the names of your OneNote notebooks.  The next level down is the section.  You can find these sections in a notebook like this:   $onenote = New-Object -ComObject OneNote.Application$scope = [Microsoft.Office.Interop.OneNote.HierarchyScope]::hsPages[ref]$xml = ”   … Continue reading

Posted in Office 2013, Powershell | Leave a comment

CimInstanceProperties

If you use Get-CimInstance and examine the object returnd – you’ll find some meta-data at the end of the object: CimClass                                  : root/cimv2:Win32_OperatingSystemCimInstanceProperties                     : {Caption, Description, InstallDate, Name…}CimSystemProperties                       : Microsoft.Management.Infrastructure.CimSystemProperties   Expand CimInstanceProperties   £> Get-CimInstance Win32_OperatingSystem | select -ExpandProperty … Continue reading

Posted in CIM, PowerShell and WMI | Leave a comment

Authorising a DHCP server and creating a scope

I recently re-built my test lab and now need to authorise the DHCP server. You can test the DHCP server: £> Get-DhcpServerSetting IsDomainJoined            : TrueIsAuthorized              : FalseDynamicBootp              : TrueRestoreStatus             : FalseConflictDetectionAttempts : 0NpsUnreachableAction      : FullNapEnabled                : FalseActivatePolicies          : True Authorisation … Continue reading

Posted in DHCP, PowerShell v4, Windows Server 2012 R2 | Leave a comment

LAST CALL for European PowerShell Summit 2014

This is the last call for attendee registration for the European PowerShell Summit 2014. The Summit is in Amsterdam – 29 September to 1 October 2014. Details from the events page http://powershell.org/wp/community-events/summit/.   Due to a change in circumstances beyond … Continue reading

Posted in Powershell, Summit | Leave a comment