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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"adminUsername": { | |
"type": "string", | |
"metadata": { | |
"description": "User name for the Virtual Machine." | |
} | |
}, |
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
### Log into Azure | |
Add-AzureRmAccount | |
$Subscription = (Get-AzureRmSubscription | Out-GridView -Title "Choose a Source & Target Subscription ..." -PassThru) | |
Select-AzureRmSubscription -SubscriptionId $Subscription.Id | |
# Upload Certificate to Azure's Key Vault | |
$securepfxpwd = ConvertTo-SecureString –String 'password' –AsPlainText –Force # Password for the private key PFX certificate | |
$certificateName = 'My-Cert' | |
$vaultName = 'MyVault' |
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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"vmName": { | |
"type": "string", | |
"metadata": { | |
"description": "Name of the VM" | |
} | |
}, |
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
$ShedService = New-Object -comobject 'Schedule.Service' | |
$ShedService.Connect() | |
$Task = $ShedService.NewTask(0) | |
$Task.RegistrationInfo.Description = 'M-Drive Mapping' | |
$Task.Settings.Enabled = $true | |
$Task.Settings.AllowDemandStart = $true | |
$trigger = $task.triggers.Create(9) | |
$trigger.Enabled = $true |
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
$net1 = new-object -ComObject WScript.Network | |
$net2 = new-object -ComObject Shell.Application | |
$net1.RemoveNetworkDrive("m:", $True, $True) | |
Start-Sleep -Seconds 2 | |
$net1.MapNetworkDrive("m:", "\\<StorageAccountName>.file.core.windows.net\music", $true, "<StorageAccountName>", "<StorageAccountKey>") | |
$net2.NameSpace('m:').Self.Name = "Drive 1 Label" | |
$net1.RemoveNetworkDrive("n:", $True, $True) | |
Start-Sleep -Seconds 2 |
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
{ | |
"bindings": [ | |
{ | |
"name": "req", | |
"type": "httpTrigger", | |
"direction": "in", | |
"methods": [ | |
"get" | |
], | |
"route": "austereo/{url}", |
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
# Setup the Azure Functions parameters | |
switch -RegEx ($REQ_QUERY_URL) | |
{ | |
\S {$url = $REQ_QUERY_URL} | |
default {$url = "http://legacy.scahw.com.au/$REQ_PARAMS_URL.xspf"} | |
} | |
# Invoke the web request to the URL | |
$iwr = Invoke-RestMethod -Uri $url |
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
### Written with Azure PowerShell Module version 4.4.1 | |
# Fill in the below variables | |
$SPDisplayName = 'User Account SP' | |
$SPPassword = 'password' # Password is required | |
$ResourceGroup = '' # Leave blank for subscription scope as to where to apply the SP role to | |
$Role = 'Contributor' # Could also be 'Owner' | |
Login-AzureRmAccount | |
### Choose Subscription |
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
# Recently tested fully with a later version of the Azure PowerShell module - Install-Module AzureRM -RequiredVersion 4.4.1 | |
#region Logon to Azure | |
Login-AzureRmAccount | |
$subscription = Get-AzureRmSubscription | Out-GridView -PassThru | |
Select-AzureRmSubscription -SubscriptionId $subscription.Id | |
#endregion | |
# Variables for YOu to fill in |
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
# This Sets up WinRM Remote PowerShell with delegated authentication while creating a self signed certificate | |
######################################################################## | |
################ Do this on the Server | |
######################################################################## | |
#Enable WinRM on a VM - with on-demand certificate creation | |
Function RemotePowerShell { | |
$process = 'cmd.exe' | |
$arguments = '/c winrm invoke restore winrm/config @{}' |