Skip to content

Instantly share code, notes, and snippets.


Andreas Wasita andreaswasita

View GitHub Profile
View SetAzureVNETGWKey.ps1
Set-AzureVNetGatewayKey -VNetName USVNET -LocalNetworkSiteName SEVNET -SharedKey mypresharedkeysevnet9876
Set-AzureVNetGatewayKey -VNetName SEVNET -LocalNetworkSiteName UVNET -SharedKey mypresharedkeysevnet9876
View NewVM.ps1
Import-module Azure
$subscription = Read-Host -Prompt 'Microsoft Azure Subscription:'
$storage = Read-Host -Prompt 'Storage Account Name:'
Set-azuresubscription -SubscriptionName $subscription -CurrentStorageAccountName $storage
#Get the latest image ; Windows Server 2012 Datacenter or mykloud2012datacenterimage
View CreateILBInstance.ps1
Add-AzureInternalLoadBalancer -ServiceName $svc -InternalLoadBalancerName $ilb –SubnetName $subnet –StaticVNetIPAddress $IP
View Add_Endpoint_ILB.ps1
Get-AzureVM –ServiceName $svc –Name $vmname | Add-AzureEndpoint -Name $epname -Protocol $prot -LocalPort $locport -PublicPort $pubport –DefaultProbe -InternalLoadBalancerName $ilb | Update-AzureVM
View CreateILB_SetEndPoint.ps1
Add-AzureInternalLoadBalancer –ServiceName $svc -InternalLoadBalancerName $ilb –SubnetName $subnet –StaticVNetIPAddress $IP
View Failover2ndsubnetWSFC.ps1
import-module failoverclusters
move-clustergroup "Cluster Group" -node azusdb001
View CreateLoadBalancedVMEndPoints.ps1
# Define variables
$AGNodes = "azsedb001","azsedb002" # SQL AAG VMs in SEVNET
$ServiceName = "azsedb" # SQL VMs Cloud Service in SEVNET
$EndpointName = "SQLAAG" # name of the endpoint
$EndpointPort = "1433" # public port to use for the endpoint
# Configure a load balanced endpoint for each node in $AGNodes, with direct server return enabled
ForEach ($node in $AGNodes)
View ClusterNetworkCloudServiceVIP.ps1
# Define variables
$ClusterNetworkName = "Cluster Network 1" # the cluster network name
$IPResourceName = "IP Address" # the IP Address resource name
$CloudServiceIP = "" # IP address of your cloud service
Import-Module FailoverClusters
Get-ClusterResource $IPResourceName | Set-ClusterParameter -Multiple @{"Address"="$CloudServiceIP";"ProbePort"="59999";SubnetMask="";"Network"="$ClusterNetworkName";"OverrideAddressMatch"=1;"EnableDhcp"=0}
# Define variables
$ClusterNetworkName = "Cluster Network 2" # the cluster network name
$IPResourceName = "IP Address" # the IP Address resource name
View azurevmcreate.js
azure vm create KloudHAProxy001 -o vmdepot-151-1-8 -l "Southeast Asia" kloudadmin [PASSWORDHERE] [--ssh] [other_options]
View Add-AzureVMAntiMalware.ps1
$service= "AzureVMAntiMalware"
$name = "MyAzureVM01"
# Get the Azure VM
$vm = Get-AzureVM –ServiceName $service –Name $name
# Add Microsoft Antimalware Agent to Azure VM
Set-AzureVMExtension -Publisher Microsoft.Azure.Security -ExtensionName IaaSAntimalware -Version 1.* -VM $vm.VM
# Update the VM which will install the Antimalware Agent