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
# first authenticate using your Azure Active Directory credentials | |
Add-AzureAccount | |
# then list all the subscriptions to get the name | |
Get-AzureSubscription | |
# now set the subscription context as well as default storage account that | |
# will be used for rest of the operations | |
# note, the account has to be created in the same Affinity Group as the Virtual Network !! | |
Set-AzureSubscription "[YOUR Subscription Name]" -CurrentStorageAccountName "[azurestorageaccount]" |
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
# first save encrypted password to a file that can later be used | |
read-host -assecurestring | convertfrom-securestring | out-file d:\tmp\securestring.txt | |
# then use the saved password | |
$password = cat d:\tmp\securestring.txt | convertto-securestring | |
# currently (August, the 13nd, 2014) only organizational accounts are supported (also with custom domain). | |
# Microsoft Accounts (Live ID) are not supported | |
$username = "user@tenant.onmicrosoft.com" # or user@yourdomain.com if 'yourdomain.com' is registered with AAD | |
$mycred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$password | |
Add-AzureAccount -credential $mycred |
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
Add-AzureAccount | |
Select-AzureSubscription -SubscriptionName "Your_Subscription_Name" | |
$vm = Get-AzureVM -ServiceName "CloudServiceName" -Name "VM_Name" | |
for ($i=6100; $i -le 6120; $i++) | |
{ | |
$EndpointName = "FtpEndpoint_" | |
$EndpointName += $i | |
Add-AzureEndpoint -Name $EndpointName -Protocol "tcp" -PublicPort $i -LocalPort $i -VM $vm | |
} | |
$vm | Update-AzureVM |
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
cmd.exe /c $env:windir\system32\inetsrv\appcmd.exe list apppool "apppoolname" /text:ProcessModel.Password |
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
Add-AzureAccount | |
# use Select-AzureSubscription in case your account has more than one | |
Select-AzureSubscription -SubscriptionName 'PUT HERE YOUR SUBSCRIPTION' | |
[System.Xml.XmlDocument] $XmlConfig = New-Object System.Xml.XmlDocument | |
# load the Antimalware extension configuration from external XML file | |
# The content of the XML needs to be: | |
# <AntimalwareConfig><AntimalwareEnabled>true</AntimalwareEnabled></AntimalwareConfig> | |
# ref.: http://msdn.microsoft.com/en-US/library/azure/dn771718 | |
$XmlConfig.load('D:\tmp\AntiMalware.config') | |
Set-AzureServiceAntimalwareExtension -ServiceName "PUT HERE THE CLOUD SERVICE NAME" -AntimalwareConfiguration $XmlConfig |
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
netsh http add urlacl url=https://+:4444/ user=[Existing user on the system] | |
netsh http add sslcert ipport=0.0.0.0:4444 certhash=[thumbprint of SSL cert] appid={[GUID - a freely chosen GUID]} |
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
# Add the Azure Account first - this will create a login promppt | |
Add-AzureAccount | |
# when you have more then one subscription - you have explicitly select the one | |
# which holds your cloud service you want to update | |
Select-AzureSubscription "<Subscription name with spaces goes here>" | |
# then Update the configuration for the cloud service | |
Set-AzureDeployment -Config -ServiceName "<cloud_service_name_goes_here>" ` | |
-Configuration "D:/tmp/cloud/ServiceConfiguration.Cloud.cscfg" ` | |
-Slot "Production" |
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
$subName = "<your_subscription_name>" | |
$storageName = "<your_storage_account_name>" | |
$reservedIPname = "<pick_a_name_for_the_reserved_ip>" | |
$reservedIPlabel = "<pick_a_label_for_the_ip>" | |
$reservedIPlocation "<set_the_location>" # i.e. West Europe | |
$serviceName = "<cloud_service_name_of_the_deployed_vm>" | |
$vmName = "<namne_of_the_vm>" | |
$vnetSiteName = "<name_of_the_vnet_site>" # if the VM will be part of Virtual Network. | |
$pathToVMConfig "<enter local path where to save current vm configuration>" | |
Add-AzureAccount |
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
Clear-AzureProfile -Force | |
cls | |
Add-AzureAccount | |
Select-AzureSubscription -SubscriptionName '<your subscription name here>' | |
Set-AzureSubscription -SubscriptionName '<your subscription name here>' -CurrentStorageAccountName '<storage account name where disks should be placed>' | |
$vm = Get-AzureVM | Where-Object { $_.Name -eq '<name of the VM to update>' } | |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel '<label of data disk 1>' -HostCaching ReadOnly -LUN 2 -VM $vm.VM | |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel '<label of data disk 2>' -HostCaching ReadOnly -LUN 3 -VM $vm.VM | |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 50 -DiskLabel '<label of data disk 3>' -HostCaching ReadOnly -LUN 4 -VM $vm.VM | |
Update-AzureVM -Name $vm.Name -ServiceName $vm.ServiceName -VM $vm.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
Switch-AzureMode -Name AzureResourceManager | |
Add-AzureAccount | |
Select-AzureSubscription "Your Subscription Name" | |
New-AzureResource -Name NewWebSite ` | |
-Location "West Europe" ` | |
-ResourceGroupName 'Default-Web-WestEurope' ` | |
-ResourceType 'Microsoft.Web/sites' ` | |
-ApiVersion '2014-04-01-preview' ` | |
-PropertyObject @{ 'ServerFarm' = 'DefaultServerFarm' } |
OlderNewer