Enable ICMP for PING

  netsh advfirewall firewall set rule name=”File and Printer Sharing (Echo Request – ICMPv4-In)” new enable=yes   netsh advfirewall firewall add rule name=”Windows Remote Management (HTTP-In)” dir=in action=allow service=any enable=yes profile=any localport=5985 protocol=tcp     netsh advfirewall firewall add rule name=”ICMPv6 echo” dir=in action=allow enable=yes protocol=icmpv6:128,any

Error when executing : Get-Azurestoragecontainer Can not find your azure storage credential. Please set current storage account using “Set-AzureSubscription” or set current storage account using “Set-AzureSubscription” or set the “AZURE_STORAGE_CONNECTION_STRING” environment variable.

When you try to get list of Containers for a given storage account, you might encounter the following error, if default storage account is not set.     Get-AzureStorageContainer : Can not find your azure storage credential. Please set current storage account using “Set-AzureSubscription” or set the “AZURE_STORAGE_CONNECTION_STRING” environment variable. At line:1 char:1 + Get-AzureStorageContainer… Read More Error when executing : Get-Azurestoragecontainer Can not find your azure storage credential. Please set current storage account using “Set-AzureSubscription” or set current storage account using “Set-AzureSubscription” or set the “AZURE_STORAGE_CONNECTION_STRING” environment variable.

Copying image file between subscriptions

[String]$sourcesubID=”ProvideSourcesubscriptionID” [String]$destinationsubID=”ProvideDestinationSubscriptionID” #Source $sourcestorageaccount=”teststorageaccount” $sourcesubscriptionname=”Some Subscription” $sourceimage =”Some sourceimage” $destinationimage=”somedestinationimage.vhd” #destination $destinationAffinityGroup=”GiveDestinationAffinityGroup” $destinationstorageaccount=”destinationstorage” $destinationSubscriptionName=”Some DestinationAzure” $destinationcontainername=”copiedvhd”   #common $thumbprint=’Grab Thumbprint from Azure portal’ #get management certificate $managementCertificate = Get-Item “cert:\CurrentUser\MY\$($thumbprint)” Select-AzureSubscription -SubscriptionName $sourcesubscriptionname Set-AzureSubscription -SubscriptionName $sourcesubscriptionname -SubscriptionId $sourcesubID -Certificate $managementCertificate   #create source storage context $sourcestoragekey = (Get-AzureStorageKey -StorageAccountName $sourcestorageaccount).Primary $sourcestoragecontext = New-AzureStorageContext –StorageAccountName $sourcestorageaccount… Read More Copying image file between subscriptions

Adding Affinity Group and Storage

$adminPassword=”hhhhhhhh” Select-AzureSubscription -SubscriptionName “Azure” New-AzureAffinityGroup -Name “PowerAFG3” -Location “East US” New-AzureStorageAccount -StorageAccountName “PowerStorage3”.ToLower() -AffinityGroup “PowerAFG3”.ToLower() -Label “PowerStorage3”.ToLower() Set-AzureStorageAccount -StorageAccountName “PowerStorage3”.ToLower() -GeoReplicationEnabled $false Set-AzureSubscription -CurrentStorageAccountName “PowerStorage3” -SubscriptionName “Azure xxx” $config=New-AzureVMConfig -Name “MyNewVM” -InstanceSize ExtraSmall -ImageName (Get-AzureVMImage)[4].ImageName $config=$config | Add-AzureProvisioningConfig -Windows -Password $adminPassword -AdminUsername “PsTestAdmin” $config=$config| New-AzureVM -ServiceName “MySvc2” -AffinityGroup “PowerAFG3” -WaitForBoot Get-AzureSubscription | Format-List -Property SubscriptionName,IsDefault,CurrentStorageAccountName… Read More Adding Affinity Group and Storage