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 / Get-AzureVmStatus.ps1
Created Nov 17, 2015
A simple script to get the status of an Azure ARM vm
View Get-AzureVmStatus.ps1
Param
(
[string]$Name
)
if ($Name)
{
$VM = Get-AzureVM |Where-Object -Property Name -Like $Name |Get-AzureVM -Status |Select-Object -Property Name, ResourceGroupName, Statuses;
$vm.Statuses |ForEach-Object {
New-Object -TypeName psobject -Property @{
Name = $VM.Name;
@jeffpatton1971
jeffpatton1971 / GPMgmt.psm1
Last active Nov 2, 2016
A rough draft of a group policy module and a script to show how to use it for a very specifc case
View GPMgmt.psm1
Function Get-Gpo
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,Position=0,ParameterSetName="DisplayName")]
[string]$DisplayName,
[Parameter(Mandatory=$true,Position=0,ParameterSetName="Id")]
[string]$Id,
[Parameter(Mandatory=$true,Position=0,ParameterSetName="All")]
@jeffpatton1971
jeffpatton1971 / New-FirewallRule.ps1
Created Jun 25, 2015
This function creates a FWRule ComObject that can be added to the firewall.
View New-FirewallRule.ps1
Function New-FirewallRule
{
<#
.SYNOPSIS
Creates a new HFnetCfg.FWRule ComObject
.DESCRIPTION
This function creates a FWRule ComObject that can be added to the firewall.
Each time you change a property of a rule, Windows Firewall commits the rule and verifies it for correctness.
As a result, when you edit a rule, you must perform the steps in a specific order. For example, if you add an ICMP
@jeffpatton1971
jeffpatton1971 / DisableSSLv3.ps1
Last active Nov 2, 2016
Disable SSL V3 Stuff and set ciphersuites
View DisableSSLv3.ps1
$Protocols = "SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols"
$Ciphers = "SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers"
$Hashes = "SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Hashes"
$KeyExchangeAlgorithms = "SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\KeyExchangeAlgorithms"
$CipherOrder = "SOFTWARE\Policies\Microsoft\Cryptography\Configuration\SSL\00010002"
Import-Module C:\projects\mod-posh\powershell\production\includes\RegistryLibrary.psm1
#
# Disable old SSL
#
@jeffpatton1971
jeffpatton1971 / New-MP.ps1
Created Apr 23, 2015
The script I use to create a sample Management Pack
View New-MP.ps1
Remove-Variable *
clear
$Mp = New-ManagementPack -ID 'ptech.LegatoNetworker' -Version '1.0.0.57' -Name 'Legato Networker MP'
Add-Reference -ManagementPack $Mp -Reference (New-Reference -ManagementPack $Mp -Alias MSDL -ID Microsoft.SystemCenter.DataWarehouse.Library -Version 6.1.7221.0 -PublicKeyToken 31bf3856ad364e35)
Add-Reference -ManagementPack $Mp -Reference (New-Reference -ManagementPack $Mp -Alias MSIL -ID Microsoft.SystemCenter.InstanceGroup.Library -Version 6.1.7221.0 -PublicKeyToken 31bf3856ad364e35)
Add-Reference -ManagementPack $Mp -Reference (New-Reference -ManagementPack $Mp -Alias SC -ID Microsoft.SystemCenter.Library -Version 6.1.7221.0 -PublicKeyToken 31bf3856ad364e35)
Add-Reference -ManagementPack $Mp -Reference (New-Reference -ManagementPack $Mp -Alias Windows -ID Microsoft.Windows.Library -Version 6.1.7221.0 -PublicKeyToken 31bf3856ad364e35)
Add-Reference -ManagementPack $Mp -Reference (New-Reference -ManagementPack $Mp -Alias System -ID System.Library -Version 6.1.7221.0 -PublicKeyToken
@jeffpatton1971
jeffpatton1971 / ManagementPack.psm1
Created Apr 23, 2015
A Collection of functions for creating an Operations Manager MP programatically
View ManagementPack.psm1
Function New-ManagementPack
{
[CmdletBinding()]
Param
(
[string]$ID = 'ptech.LegatoNetworker',
[string]$Version = '1.0.0.57',
[string]$Name = 'Legato Networker MP'
)
Begin
@jeffpatton1971
jeffpatton1971 / xmlModule.psm1
Last active May 28, 2017
A collection of PowerShell functions for creating xml data files.
View xmlModule.psm1
Function New-XmlDocument
{
[CmdletBinding()]
Param
(
[string]$Root,
[string[]]$Elements
)
Begin
{
@jeffpatton1971
jeffpatton1971 / MofMofule.psm1
Last active Aug 29, 2015
A pair of cmdlets for working with mof files, this is not complete, currently it only handles a few mof instances 'MSFT_RegistryResource','MSFT_RoleResource','MSFT_ServiceResource','OMI_ConfigurationDocument'
View MofMofule.psm1
Function Get-MofFile
{
[CmdletBinding()]
Param
(
[string]$Path
)
Begin
{
$MofFile = Get-Content $Path
@jeffpatton1971
jeffpatton1971 / Export-FederationConfigurationV2.ps1
Last active Jun 4, 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)]
@jeffpatton1971
jeffpatton1971 / retrosheet_zip_files.TXT
Created Mar 25, 2015
A list of retrosheet download urls
View retrosheet_zip_files.TXT
http://www.retrosheet.org/events/1952eve.zip
http://www.retrosheet.org/events/1953eve.zip
http://www.retrosheet.org/events/1954eve.zip
http://www.retrosheet.org/events/1955eve.zip
http://www.retrosheet.org/events/1956eve.zip
http://www.retrosheet.org/events/1957eve.zip
http://www.retrosheet.org/events/1958eve.zip
http://www.retrosheet.org/events/1959eve.zip
http://www.retrosheet.org/events/1960eve.zip
http://www.retrosheet.org/events/1961eve.zip
You can’t perform that action at this time.