Skip to content

Instantly share code, notes, and snippets.

View micmaher's full-sized avatar

Michael Maher micmaher

  • Home
  • Dublin, Ireland
View GitHub Profile
@micmaher
micmaher / sendEWSemail.ps1
Last active February 4, 2022 22:53
PowerShell Script - Send Email over Internet using Exchange Web Services API
Function Send-EWSEmail
{
<#
.SYNOPSIS
Sends email via Exchange Web Services
.DESCRIPTION
Must be run with parameters
.PARAMETER Username
@micmaher
micmaher / customPSEnv.psm1
Last active September 5, 2018 15:38
Customise the your PowerShell Environment
Function Set-PSEnv{
<#
.SYNOPSIS
Customise PowerShell Environment
.DESCRIPTION
Can set up PowerShell profile
Can Set up Package Management (PowerShell Gallery), Chocolatey, Implicit Remoting, Themes,
Can map a PSDrive to OneDrive, Update Help
.NOTES
Author: Michael Maher
@micmaher
micmaher / getFreshADUser.ps1
Last active October 10, 2017 04:44
Get AD Users Created since (x) Days - include Office 365 attributes
Function Get-FreshADUser
<#
.Synopsis
Check for users created in AD since (x) days
.DESCRIPTION
Lists users created in AD since specified date
The number of days to check back is a mandatory prarmeter
Useful in a domain migration scenario
@micmaher
micmaher / importContosoUser.psm1
Last active October 10, 2017 04:40
PowerShell Module - Create AD User with Attributes needed for Office 365 Integration
#Requires RunAsAdministrator
<#
.Author
Michael Maher on 2/2/16
#>
Function Request-Address{
<#
.DESCRIPTION
Reads in Office 365 required attributes and creates users
#Requires -Version 4.0
<#
.SYNOPSIS
Gets the Firewall State for for a local, remote or a piped list of machines
.DESCRIPTION
Will require PowerShell 4.0 or later
Gets Public, Private and Domain Profiles
.EXAMPLE
@micmaher
micmaher / Euro2016.psm1
Last active January 4, 2017 09:16
Get Euro 2016 Team and Player Data from UEFA
Function Get-AllTeams{
<#
.SYNOPSIS
List all qualifying teams
.NOTES
Author: Michael Maher
Date: 14/2/16
#>
[CmdletBinding()]
Function Get-TaskDuration {
<#
.SYNOPSIS
Returns the duration (execution time) of the most recent run of the specified scheduled task.
Michael Klement did a great deal of this
.DESCRIPTION
Returns the execution time of the most recent completed run of the specified scheduled tasks as [timespan] instances.
@micmaher
micmaher / moveImageCloudFiles.ps1
Created June 13, 2016 10:33
Move Rackspace Image to Cloud Files using the Pitchfork API
$DDI='YOUR ID HERE'
$Region = 'YOUR SITE HERE'
$AuthToken = "YOUR TOKEN HERE"
$URI="https://$region.images.api.rackspacecloud.com/v2/$DDI/tasks/"
# ImageID
$imageid = 'YOUR IMAGE ID HERE'
$container = "YOUR CONTAINER HERE"
# Request Headers
@micmaher
micmaher / PortScanner.ps1
Last active May 11, 2016 18:24
Analyse what ports a process is using (uses Dynamic Parameters)
#Requires -Version 5.0
Function Show-Port {
<#
.SYNOPSIS
Can run and terminate or refresh at specified interval (1 - 60 seconds)
.DESCRIPTION
Show open network connections for a given process
The active process list are presented dynamically for selection
.EXAMPLE
Displays the ports in use by the process firefox and refreshes at 5 second intervals
USE [build]
GO
/****** Object: StoredProcedure [dbo].[inserthotfixPresent] Script Date: 26/04/2016 17:21:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO