This file contains hidden or 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
$VMs = Get-AzureRmVM | |
$Results = @() | |
ForEach ($VM in $VMs) | |
{ | |
ForEach ($NicID in $VM.NetworkInterfaceIDs) | |
{ | |
$Nic = Get-AzureRmResource -ResourceId $NicID | Get-AzureRmNetworkInterface | |
$Result = New-Object PSObject | |
$Result | Add-Member -MemberType NoteProperty -Name "ResourceGroupName" -Value $VM.ResourceGroupName |
This file contains hidden or 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 enable security settings for all database servers and databases in a subscription | |
.NOTES | |
AUTHOR: @dazfuller | |
LASTEDIT: Jan 30, 2016 | |
#> | |
$connectionName = "AzureRunAsConnection" |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |