Skip to content

Instantly share code, notes, and snippets.

View realslacker's full-sized avatar

Shannon Graybrook realslacker

View GitHub Profile
@realslacker
realslacker / Enable-VSSShadowCopies.ps1
Created June 6, 2018 15:34
Enable VSS Shadow Copies on remote computers.
<#
.SYNOPSIS
Enable VSS Shadow Copies on remote computers.
.DESCRIPTION
Enable VSS Shadow Copies on remote computers. The default settings will take a snapshot every 1 hour and use up to 5% of the disk.
.PARAMETER ComputerName
The computer(s) to enable VSS on. If piping from Get-ADComputer use 'Get-ADComputer -Filter * | select Name' to handle a bug in Get-ADComputer's piping.
.PARAMETER DriveLetter
Which drive to enable VSS on.
.PARAMETER CacheSize
<#
.SYNOPSIS
Reformats a MAC Address depending on the use case.
.DESCRIPTION
Takes a string or strings that should be reformated as a MAC address.
.PARAMETER Address
The MAC Address to reformat as a string
.PARAMETER Separator
What separator should be inserted, defaults to ':'
.EXAMPLE
<#
.SUMMARY
Converts bytes values into human readable forms.
.DESCRIPTION
Converts bytes values into human readable forms.
.PARAMETER Bytes
Input in Bytes
@realslacker
realslacker / Profile.ps1
Created July 20, 2018 23:33
One liner to bump up TLS available for Invoke-WebRequest, Invoke-RestMethod, etc...
# Bump up the TLS profile to the max value supported by your system
[System.Enum]::GetValues('Net.SecurityProtocolType') |
Where-Object { $_ -gt [System.Math]::Max( [Net.ServicePointManager]::SecurityProtocol.value__, [Net.SecurityProtocolType]::Tls.value__ ) } |
ForEach-Object {
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor $_
}
# The rest of your Profile.ps1 ...
@realslacker
realslacker / Get-GroupwiseProxyAccess.ps1
Created August 23, 2018 19:50
Reads proxy access information from GroupWise 2012 or later. Uses the SOAP API to fetch proxy access ACLs from GroupWise.
<#
.SYNOPSIS
Reads proxy access information from GroupWise 2012 or later.
.DESCRIPTION
Reads proxy access information from GroupWise 2012 or later. Uses the SOAP API to fetch proxy access ACLs from GroupWise.
.PARAMETER User
User(s) to query proxy access for.
<#
.SYNOPSIS
Installs a wireless profile from an exported XML file.
.DESCRIPTION
Installs a wireless profile from an exported XML file, stores the version (install date and time) in the registry.
Author: Shannon Brooks
<#
.SYNOPSIS
Removes a wireless profile from an exported XML file.
.DESCRIPTION
Removes a wireless profile from an exported XML file, clears the version from the registry.
Author: Shannon Brooks
<#
.SYNOPSIS
Test for a wireless profile from an exported XML file or by Name.
.DESCRIPTION
Test for a wireless profile from an exported XML file, checks for a minimum and/or maximum version if supplied.
Author: Shannon Brooks
@realslacker
realslacker / Submit-OutlookMessageToHelpdesk.ps1
Created September 17, 2018 18:48
Sends selected messages from Outlook through an SMTP relay to your helpdesk email. Allows redirecting arbitrary emails to a helpdesk email for ZenDesk.
# compile command:
# ps2exe.ps1 -inputFile .\Submit-OutlookMessageToHelpdesk.ps1 -outputFile .\Submit-OutlookMessageToHelpdesk.exe -runtime40 -x86 -noConsole -iconFile .\forward_email.ico
$ForwardTo = "Help Desk <helpdesk@domain.com>"
$SmtpServer = "smtp.corp.domain.com"
$SmtpUseSSL = $true
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName Microsoft.Office.Interop.Outlook
@realslacker
realslacker / Get-CurrentUserCompatibilityModeSettingForGPP.ps1
Last active October 2, 2018 17:50
Pulls the current user's Compatibility Mode settings from the registry and creates a Group Policy Registry Preference XML string for pasting into Group Policy Manager.
<#PSScriptInfo
.VERSION 2018.10.02.1248
.GUID 75bfca34-ff9c-4cac-beab-51a685d42c44
.AUTHOR Shannon Brooks
.COMPANYNAME Brooksworks