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
get-cloudrive | |
invoke-webrequest https://github.com/Azure/AzureStack-Tools/archive/master.zip -OutFile master.zip | |
expand-archive master.zip -DestinationPath . -Force | |
cd AzureStack-Tools-master | |
Import-Module .\Policy\AzureStack.Policy.psm1 | |
Get-AzureRMSubscription |
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
#Log in to Azure account | |
Login-AzureRmAccount | |
#Get list of Azure Subscription ID's | |
$Subs = (get-AzureRMSubscription).ID | |
#Loop through the subscriptions to find all empty Resource Groups and store them in $EmptyRGs | |
ForEach ($sub in $Subs) { | |
Select-AzureRmSubscription -SubscriptionId $Sub | |
$AllRGs = (Get-AzureRmResourceGroup).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
Login-AzureRmAccount | |
$SubscriptionId = (Get-AzureRmSubscription | select Name, State, SubscriptionId, TenantId | Out-GridView -Title "Azure Subscription Selector" -PassThru).SubscriptionId | |
Get-AzureRmSubscription -SubscriptionId $SubscriptionId | Select-AzureRmSubscription |
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
New-NetFirewallRule -DisplayName "Allow ICMPv4-In" -Protocol ICMPv4 | |
$vnet1Name = 'Pixel1' | |
$vnet1RG = 'Pixel1' | |
$vnet2Name = 'Pixel2' | |
$vnet2RG = 'Pixel2' | |
$vnet1 = Get-AzureRmVirtualNetwork -Name $vnet1Name -ResourceGroupName $vnet1RG | |
$vnet2 = Get-AzureRmVirtualNetwork -Name $vnet2Name -ResourceGroupName $vnet2RG | |
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
#Resource Lock | |
$LockName = "LockCloudWitnes" | |
$ResourceName = "pixelcloudwitness" | |
$ResourceType = (Get-AzureRmResource -Name $ResourceName).resourcetype | |
$RGName ="PIXELLAB" | |
New-AzureRmResourceLock -LockLevel CanNotDelete -LockName $LockName -ResourceName $ResourceName -ResourceType $ResourceType -ResourceGroupName $RGName | |
#Resource Group Lock | |
$LockName = "PIXELLABLock" | |
$RGName ="PIXELLAB" |
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
#Bulk Import A Records | |
Import-CSV -Path "C:\scripts\arecords.csv" | ForEach-Object { New-AzureRmDnsRecordSet -Name $_.Name -RecordType $_.RecordType -ZoneName $_.ZoneName -ResourceGroupName $_.ResourceGroupName-Ttl $_.TTL -DnsRecords (New-AzureRmDnsRecordConfig -IPv4Address $_.Value) } | |
#Bulk Import CNAME Records | |
Import-CSV -Path "C:\scripts\cnamerecords.csv" | ForEach-Object { New-AzureRmDnsRecordSet -Name $_.Name -RecordType $_.RecordType -ZoneName $_.ZoneName -ResourceGroupName $_.ResourceGroupName-Ttl $_.TTL -DnsRecords (New-AzureRmDnsRecordConfig -Cname $_.Value) } |
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
Invoke-AzureRmVMRunCommand -ResourceGroupName '<myResourceGroup>' -Name '<myVMName>' -CommandId 'RunPowerShellScript' -ScriptPath '<pathToScript>' -Parameter @{"arg1" = "var1";"arg2" = "var2"} |
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
az aks get-credentials --resource-group PixelContainers --name PixelCluster | |
kubectl get nodes | |
az aks install-cli | |
az login | |
az aks get-credentials --resource-group PixelContainers --name PixelCluster |
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
Install-Module PowerShellGet –Repository PSGallery –Force | |
Install-Module -name AzureRM.Profile -requiredversion 5.5.0 | |
Install-Module -Name AzureRM.Security -AllowPrerelease | |
Import-Module AzureRM.Profile -RequiredVersion 5.5.0 | |
Import-Module AzureRM.Security |
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
resource "azurerm_virtual_machine_extension" "domjoin" { | |
name = "domjoin" | |
location = "${var.location}" | |
resource_group_name = "${var.image_resource_group}" | |
virtual_machine_name = "${var.prefix}" | |
publisher = "Microsoft.Compute" | |
type = "JsonADDomainExtension" | |
type_handler_version = "1.3" | |
# What the settings mean: https://docs.microsoft.com/en-us/windows/desktop/api/lmjoin/nf-lmjoin-netjoindomain | |
settings = <<SETTINGS |