This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
Finds and removes VMs which have not been started within a defined period of time | |
.NOTES | |
AUTHOR: @dazfuller | |
LASTEDIT: Jan 26, 2017 | |
#> | |
# Define the number of days after which a VM is considered dead | |
$NumberDays = 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
Enables Transparent Data Encryption on all Azure SQL Databases within a subscription | |
.NOTES | |
AUTHOR: @dazfuller | |
LASTEDIT: Jan 12, 2017 | |
#> | |
$connectionName = "AzureRunAsConnection" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
A runbook which finds storage accounts without encryption services enabled and | |
enables them | |
.NOTES | |
AUTHOR: @dazfuller | |
LASTEDIT: Jan 11, 2017 | |
#> | |
workflow EnableStorageAccountEncryption |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
A runbook which finds unrestricted inbound RDP rules on the standard RDP port and | |
changes their action to Deny | |
.NOTES | |
AUTHOR: @dazfuller | |
LASTEDIT: Jan 10, 2017 | |
#> | |
workflow DisableRDPRules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workflow TestWorkflowRunbook | |
{ | |
$connectionName = "AzureRunAsConnection" | |
try | |
{ | |
$servicePrincipalConnection = Get-AutomationConnection -Name $connectionName | |
"Logging into Azure..." | |
Login-AzureRmAccount ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.DESCRIPTION | |
A runbook which will scale down different types of resources for each resource group | |
.NOTES | |
AUTHOR: @dazfuller | |
LASTEDIT: Dec 20, 2016 | |
#> | |
$connectionName = "AzureRunAsConnection" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$AppServicePlans = Get-AzureRmAppServicePlan | |
$AppServicePlans | Sort-Object ResourceGroup, Name | Select-Object -Property ` | |
ResourceGroup, | |
Name, | |
Location, | |
@{ name = "SkuName"; expression = { $_.Sku.Name } }, | |
@{ name = "SkuSize"; expression = { $_.Sku.Size } }, | |
@{ name = "SkuTier"; expression = { $_.Sku.Tier } }, | |
NumberOfSites, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.WindowsAzure.Storage; | |
using Microsoft.WindowsAzure.Storage.Auth; | |
using Microsoft.WindowsAzure.Storage.Blob; | |
namespace AzureBlobStorage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-Password { | |
Param ( | |
[ValidateRange(8, 20)] | |
[int] $PasswordLength = 14, | |
[ValidateRange(1, 4)] | |
[int] $MinimumSpecialCharacters = 3 | |
) | |
# Specify the range of ASCII characters to use, avoiding ambiguous characters such as 0, O, o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
Write-Error "Need to run as an administrator" | |
return -1 | |
} | |
$source = "https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem" | |
$file = $source.Split("/")[-1] | |
$out = Join-Path "$($env:USERPROFILE)\Downloads" -ChildPath $file | |
Invoke-WebRequest -Uri $source -OutFile $out |