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 / Enable-WinRM.ps1
Created Feb 4, 2017
This script will enable WinRM
View Enable-WinRM.ps1
param
(
[string]$Hostname = $env:COMPUTERNAME
)
try
{
$ErrorActionPreference = 'Stop';
$CertificateThumbprint = (New-SelfSignedCertificate -DnsName $Hostname -CertStoreLocation Cert:\LocalMachine\My).Thumbprint;
New-WSManInstance -ResourceURI 'winrm/config/listener' -SelectorSet @{Address='*';Transport='https'} -ValueSet @{Hostname=$Hostname;CertificateThumbprint=$CertificateThumbprint}
}
@jeffpatton1971
jeffpatton1971 / StorageAccountCopy.ps1
Last active Jan 31, 2017
A script to copy Blobs between Azure Storage Accounts
View StorageAccountCopy.ps1
param
(
[string]$SourceStorageAccountName,
[string]$SourceStorageAccountResourcegroupName,
[string]$SourceStorageAccountContainerName,
[string]$DestStorageAccountKey,
[string]$DestStorageAccountContainerName
)
try
@jeffpatton1971
jeffpatton1971 / LinuxConfiguation.ps1
Created Dec 31, 2016
Simple configuration, all vm's with role == server should get user01 and all vm's with role == webserver should get apache installed.
View LinuxConfiguation.ps1
Configuration LinuxConf
{
Import-DscResource -ModuleName nx
Node $AllNodes.Where{$_.Role -like "*server"}.NodeName
{
nxUser NewAccount
{
UserName = 'user01'
Ensure = 'Present'
View Get-AzureAssignedPrivateIpAddress.ps1
Param
(
[Parameter(Mandatory=$true)]
[string]$VirtualNetworkName,
[Parameter(Mandatory=$false)]
[string]$SubnetName = '',
[Parameter(Mandatory=$true)]
[string]$Location,
[Parameter(Mandatory=$true)]
[string]$ResourceGroupName
@jeffpatton1971
jeffpatton1971 / Update-PowerState.ps1
Last active Jul 28, 2016
A modification of the AzureAutomation Start-AzureV2VM script (https://github.com/azureautomation/runbooks/blob/master/Utility/Start-AzureV2VM.ps1). This script takes PowerState as a parameter, and checks to see if the vm is in the properstate before attempting the operation. Added a Workflow version of the same script that should run faster, the…
View Update-PowerState.ps1
param
(
[Parameter(Mandatory=$false)]
[string]$AzureConnectionAssetName = 'AzureRunAsConnection',
[Parameter(Mandatory=$false)]
[string]$ResourceGroupName,
[Parameter(Mandatory=$true)]
[ValidateSet('PowerState/running','PowerState/deallocated')]
[string]$PowerState
)
@jeffpatton1971
jeffpatton1971 / Enable-AzureNSGDiagnostics.ps1
Created Jan 14, 2016
A script that will enable diagnostics on network security groups. This will add the logs to a specific storage account.
View Enable-AzureNSGDiagnostics.ps1
Param
(
[string]$StorageAccountName,
[string]$StorageAccountResourceGroup
)
try
{
$ErrorActionPreference = "Stop"
$Error.Clear()
@jeffpatton1971
jeffpatton1971 / Enable-AzureNSGDiagnostics.ps1
Last active Jan 15, 2016
This is my take of the onboarding code for network security groups. There is no armclient dependency, but you will need the latest Azure Powershell Cmdlets installed.
View Enable-AzureNSGDiagnostics.ps1
Param
(
[string]$StorageAccountName,
[string]$StorageAccountResourceGroup
)
try
{
$ErrorActionPreference = "Stop"
$Error.Clear()
@jeffpatton1971
jeffpatton1971 / Get-AzureAssignedPrivateIpAddress.ps1
Last active Nov 30, 2015
This script will return the assigned private ips of each machine in a given subnet. If no subnet is provided it will return the assigned private ips for every machine in all subnets with a configuration.
View Get-AzureAssignedPrivateIpAddress.ps1
Param
(
[Parameter(Mandatory=$true)]
[string]$VirtualNetworkName,
[Parameter(Mandatory=$false)]
[string]$SubnetName = '',
[Parameter(Mandatory=$true)]
[string]$Location,
[Parameter(Mandatory=$true)]
[string]$ResourceGroupName
@jeffpatton1971
jeffpatton1971 / Get-AzureFile.ps1
Last active Nov 24, 2015
Get a file from an azure container
View Get-AzureFile.ps1
Param
(
[Parameter(Mandatory=$true)]
[string]$ResourceGroupName,
[Parameter(Mandatory=$false)]
[string]$StorageAccountName,
[Parameter(Mandatory=$true)]
[string]$ContainerName,
[Parameter(Mandatory=$true)]
[string]$Path
@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;
You can’t perform that action at this time.