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
@lukemurraynz
lukemurraynz / Start-DFS.ps1
Last active June 14, 2019 12:19
Starts DFS service, and dependencies such as Remote Registry.
#requires -Version 2.0
<#
.SYNOPSIS
Starts the DFS service
.DESCRIPTION
Changes the Remote Registry service to Automatic start-up and Start the DFS NameSpace service dependencies, then start the DFS namespace service.
If the service does not start, it will retrieve the last 10 event log items from the DFS log.
@lukemurraynz
lukemurraynz / RemoveSnapshotvSphere.ps1
Last active December 13, 2016 18:35
Using PowerShell to remove Snapshots from Virtual Machines in vSphere
<#
Author: Luke Murray (Luke.Geek.NZ)
Version: 1.0
requires -Version 1
requires -PSSnapin VMware.VimAutomation.Core
Purpose: To remove all VMWare Snapshots on any Windows Server entered into the SnapshotRemoval.txt document.
The following Variables will need to be set for your environment:
$vsphereserver = Your vSphere Server Bane
@lukemurraynz
lukemurraynz / Remove-AppVPackage.ps1
Created December 13, 2016 19:10
Remove App-V packages from a Windows workstation
#requires -Version 2 -Modules AppvClient
<#
Author: Luke Murray (Luke.Geek.NZ)
Version: 0.1
Purpose:
The purpose of this script is to remove any App-V package data stored on a workstation (tested with Windows 7 X64 ENT). This script will delete all App-V locally stored package data so it could be redownloaded again.
This needs to be ran using an Elevated PowerShell ISE or PowerShell window.
@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"
@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 / 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
)
$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)
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
@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
#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