Skip to content

Instantly share code, notes, and snippets.

Avatar

Shannon Graybrook realslacker

View GitHub Profile
@realslacker
realslacker / Enable-VSSShadowCopies.ps1
Created Jun 6, 2018
Enable VSS Shadow Copies on remote computers.
View Enable-VSSShadowCopies.ps1
<#
.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
View Format-MACAddress.ps1
<#
.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
View Convert-BytesToHumanReadable.ps1
<#
.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 Jul 20, 2018
One liner to bump up TLS available for Invoke-WebRequest, Invoke-RestMethod, etc...
View Profile.ps1
# 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 Aug 23, 2018
Reads proxy access information from GroupWise 2012 or later. Uses the SOAP API to fetch proxy access ACLs from GroupWise.
View Get-GroupwiseProxyAccess.ps1
<#
.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.
View Install-WiFiProfile.ps1
<#
.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
View Remove-WiFiProfile.ps1
<#
.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
View Test-WiFiProfile.ps1
<#
.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 Sep 17, 2018
Sends selected messages from Outlook through an SMTP relay to your helpdesk email. Allows redirecting arbitrary emails to a helpdesk email for ZenDesk.
View Submit-OutlookMessageToHelpdesk.ps1
# 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 Oct 2, 2018
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.
View Get-CurrentUserCompatibilityModeSettingForGPP.ps1
<#PSScriptInfo
.VERSION 2018.10.02.1248
.GUID 75bfca34-ff9c-4cac-beab-51a685d42c44
.AUTHOR Shannon Brooks
.COMPANYNAME Brooksworks