Skip to content

Instantly share code, notes, and snippets.

Jeff Patton jeffpatton1971

Block or report user

Report or block jeffpatton1971

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeffpatton1971
jeffpatton1971 / Export-FederationConfigurationV2.ps1
Last active Nov 15, 2019
This is the Export-FederationConfiguration.ps1 and Import-FederationConfiguration.ps1 files that are found in the C:\Windows\ADFS folder. I have made a few minor changes in each see this thread for details. https://social.technet.microsoft.com/Forums/en-US/02a5594b-00df-4731-ae98-992956bafc19/adfs-unable-to-export-the-adfs-configuration?forum=wi…
View Export-FederationConfigurationV2.ps1
<#############################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
############################################################>
[CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="Medium", DefaultParameterSetName="Default")]
Param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true, ValueFromPipelinebyPropertyName=$true)]
[string] $Path,
[Parameter(Mandatory=$false)]
View data.json
{
"subject": "linescore_mlb_2019_08_09_anamlb_bosmlb_1",
"copyright": "NOTICE: This file is no longer actively supported. Please use the MLB Stats API (http://statsapi.mlb.com/docs/) as an alternative. Copyright 2019 MLB Advanced Media, L.P. Use of any content on this page acknowledges agreement to the terms posted here http://gdx.mlb.com/components/copyright.txt",
"data": {
"game": {
"linescore": [{
"away_inning_runs": "3",
"home_inning_runs": "1",
"inning": "1"
}, {
@jeffpatton1971
jeffpatton1971 / New-RulesFromNetstat.ps1
Created Jan 15, 2014
A script to create firewall rules based on netstat output
View New-RulesFromNetstat.ps1
<#
Create FW rules for TCP and UDP Listening Ports
netstat -an -p tcp |Select-String "Listening"
netstat -an -p udp |Select-String "Listening"
for each entry in netstat create firewall rule
name = -p tcp|udp port port #
description = automatic allow rule generated by powershell on get-date
@jeffpatton1971
jeffpatton1971 / WebServer.ps1
Last active Apr 16, 2019
This DSC Configuration shows off several features available via DSC. It installs the Web-Server feature, and several additional web features that each depend on Web-Server being installed. It uses the Package reference to install the WebDeploy MSI, based on that path passed in the param, which also depends on Web-Server. It uses a Script referen…
View WebServer.ps1
Configuration BasicWebServer
{
param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$ComputerName,
[string]$Source = $null,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
@jeffpatton1971
jeffpatton1971 / Get-BingImage.ps1
Last active Sep 6, 2018
This script can be used to download Bing background images for use as your wallpaper or to save. It uses a specially crafted URL that I found while searching for a way to download them. It appears that the URL will let you go back 18 days, or the last 8 images. When you set Index to 18 and NumberOfImages to 8 a total of 19 images will be downloa…
View Get-BingImage.ps1
<#
.SYNOPSIS
Use this script to download the Bing background image.
.DESCRIPTION
This script can be used to download Bing background images for use
as your wallpaper or to save. It uses a specially crafted URL that I
found while searching for a way to download them.
It appears that the URL will let you go back 18 days, or the last 8
images. When you set Index to 18 and NumberOfImages to 8 a total of
@jeffpatton1971
jeffpatton1971 / Get-WinEventTail.ps1
Last active Aug 13, 2018
This function will allow you to tail Windows Event Logs. You specify a Logname for either the original logs, Application, System and Security or the new format for the newer logs Microsoft-Windows-PowerShell/Operational
View Get-WinEventTail.ps1
Function Get-WinEventTail
{
<#
.SYNOPSIS
A tail cmdlet for Eventlogs
.DESCRIPTION
This function will allow you to tail Windows Event Logs. You specify
a Logname for either the original logs, Application, System and Security or
the new format for the newer logs Microsoft-Windows-PowerShell/Operational
.PARAMETER LogName
@jeffpatton1971
jeffpatton1971 / encoding-helpers.ps1
Created Mar 20, 2018 — forked from jpoehls/encoding-helpers.ps1
Convert-FileEncoding and Get-FileEncoding
View encoding-helpers.ps1
<#
.SYNOPSIS
Converts files to the given encoding.
Matches the include pattern recursively under the given path.
.EXAMPLE
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8
#>
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') {
$count = 0
@jeffpatton1971
jeffpatton1971 / New-SCOMChannelO365.ps1
Last active Nov 27, 2017
This script is used as a command channel to generate alert emails from the data stored in the Alert Context tab of the Office 365 Message Center and Incident alerts. There is no simple way to retrieve this data as that tab is more or less free form, so the data is pulled from SCOM, filtered for New resolution state and then send to the list of e…
View New-SCOMChannelO365.ps1
<#
.SYNOPSIS
A custom command channel to generate emails from Office 365 Alert Context data
.DESCRIPTION
This script is used as a command channel to generate alert emails from the data
stored in the Alert Context tab of the Office 365 Message Center alerts. There
is no simple way to retrieve this data as that tab is more or less free form,
so the data is pulled from SCOM, filtered for New resolution state and then
send to the lsit of email addresses.
.PARAMETER SmtpHost
View odbc-excel.ps1
param
(
$strFileName = "C:scriptsfile.xlsx",
$strSheetName = 'Out'
)
if (!(($strSheetName.Substring($strSheetName.Length-1,1)) -eq '$'))
{
$strSheetName = "$($strSheetName)`$"
}
$strProvider = "Provider=Microsoft.ACE.OLEDB.12.0"
View rollback.ps1
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client";
Remove-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\
You can’t perform that action at this time.