Skip to content

Instantly share code, notes, and snippets.

View lukemurraynz's full-sized avatar
☁️
Breaking things!

Luke Murray lukemurraynz

☁️
Breaking things!
View GitHub Profile
#requires -Version 3.0 -Modules Az.Network
<#
.SYNOPSIS
Custom script to update your Azure Local Network Gateway with your Public IP
.DESCRIPTION
Updates the Azure Local Network Gateway with your Public IP
Version: 1.0
Author: Luke Murray (Luke.Geek.NZ)
If no Public IP parameter is set, it will automatically grab the Public IP of the computer running it and set it.
The intention of this script is to run as as a scheduled task on your network, which connects to Azure and updates. Intended for Homelabs and scenarios which have Dynamic IPs.
#requires -Version 4.0
<#
Author: Luke Murray (Luke.Geek.NZ)
Version: 0.1
Purpose: Windows 10 Baseline Hardening using DSC per DoD DISA STIG recommendations 22/06/18.
#>
Configuration 'Win10'
{
Import-DscResource -ModuleName PSDesiredStateConfiguration
#requires -Version 4.0
<#
Author: Luke Murray (Luke.Geek.NZ)
Version: 0.1
Purpose: Windows Server 2016 Baseline Hardening using DSC per DoD DISA STIG recommendations 22/06/18.
#>
Configuration 'Server2016'
{
#requires -version 3.0
<#
.SYNOPSIS
Connect-Azure
.DESCRIPTION
Loads the Azure Resource Manager modules, then connects to Azure and opens a Window allowing you to select what subscription.
.NOTES
Version: 1.1
@lukemurraynz
lukemurraynz / Disable-SMB1.ps1
Created June 9, 2018 09:43
This script disables SMB1
#requires -Version 3.0 -Modules Dism
<#
.SYNOPSIS
Disables SMB1
.DESCRIPTION
This script disables SMB1. If Windows 10 or greater it will use the PowerShell cmdlet to disable SMB1 with no restart, if the OS is
less than Windows 10 - such as Windows 7 it will set the services to be disabled manually. Needs to be run as Administrator.
Main script hosted on the following repository: https://github.com/lukemurraynz/PowerOfTheShell/blob/master/Other/Disable-SMB1.ps1
function Connect-Azure
{
<#
.SYNOPSIS
Connect-Azure Function to login to Azure - using Resource Groups.
.DESCRIPTION
Prompts for Azure user credentials, prompts to select Azure Subscription and passes through to select an Azure subscrption.
.EXAMPLE
Connect-Azure
.VERSION: 0.1
$url ='https://www.subway.co.nz/sub-of-the-day'
$response = Invoke-WebRequest -Uri $url
$Date = Get-Date
$week = $response.ParsedHtml.body.getElementsByClassName('day') | Select-Object -ExpandProperty innerText
foreach ($day in $week)
{
if ($Date.DayOfWeek -eq $day)
@lukemurraynz
lukemurraynz / Download_MSIgnite_NZ_Videos_2016.ps1
Last active December 29, 2016 21:58
Download MS Ignite NZ 2016 Videos & Slides
#Script written by Vlad Catrinescu
#Modifed for NZ Ignite 2016 - Luke Murray (www.luke.geek.nz)
#Visit my site www.absolute-sharepoint.com
#Twitter: @vladcatrinescu
#Originally Posted here: https://absolute-sharepoint.com/2016/10/the-ultimate-script-to-download-microsoft-ignite-2016-videos-and-slides
Param (
[string]$keyword,
[string]$session
)
@lukemurraynz
lukemurraynz / config.xml
Created December 28, 2016 08:25
Visio 2010 Standard Config file
<Configuration Product="Visio>
<PIDKEY Value="767HD-QGMWX-8QTDB-9G3R2-KHFG" />
</Configuration>
@lukemurraynz
lukemurraynz / App-V Discovery Script.ps1
Last active December 22, 2016 19:38
App-V Discovery Script
#App-V Discovery Script for SCCM Configuration Baseline
#requires -Modules AppvClient
#requires -Version 2.0
$Now = Get-Date
$Days = 30
$TargetFolder = "$env:ProgramData\App-V"
$LastAccessTime = $Now.AddDays(-$Days)
$Files = Get-ChildItem -Path $TargetFolder | Where-Object -FilterScript {
$_.LastAccessTime -lt "$LastAccessTime"